Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button2.Click
Try
Using conn As MySQLConnection = New MySQLConnection( _
New MySQLConnectionString("localhost", _
"test", _
"root", _
"", _
3306).AsString)
conn.Open()
Dim icmd As MySQLInsertCommand = New MySQLInsertCommand(conn, _
New Object(,) {{"field1", "111"}, _
{"field2", "222"}, _
{"field3", "333"}}, "mytest")
End Using
Catch ex As MySQLException
MessageBox.Show(ex.Message, "MySQLエラー")
Catch ex As Exception
MessageBox.Show(ex.Message, "一般エラー")
End Try
MessageBox.Show("処理完了")
End Sub
|