Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim shkcode1 As String
Dim shimei1 As String
Dim inymd1 As String
Dim sqlstr As String
' Dim dr As DataRow
shkcode1 = DataGridView1.Rows(4).Cells(0).Value
shimei1 = DataGridView1.Rows(4).Cells(1).Value
inymd1 = DataGridView1.Rows(4).Cells(2).Value
sqlstr = " insert into EA_M1施设职员(shkcode,shimei,inymd) values ('" & shkcode1 & "','" & shimei1 & "','" & inymd1 & "')"
Dim connection As New OracleConnection("连接字符串")
Dim cmd As New OracleCommand(sqlstr, connection)
Try
connection.Open()
Dim rows As Integer = cmd.ExecuteNonQuery()
if rows > 0 then
'说明执行成功了.可以做之后的操作
end if
Catch E As System.Data.OracleClient.OracleException
connection.Close()
Throw New Exception(E.Message)
End Try
end sub
ps:建议去学学ADO.Net 不难的.
这我也不会那