Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button5.Click
Try
Using conn As MySQLConnection = New MySQLConnection( _
New MySQLConnectionString("localhost", _
"test", _
"root", _
"", _
3306).AsString)
conn.Open()
Dim dcmd As MySQLDeleteCommand = New MySQLDeleteCommand(conn, _
"emp", _
New Object(,) {{"id", "=", "3"}}, _
Nothing)
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
|