Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button4.Click
Try
Using conn As MySQLConnection = New MySQLConnection( _
New MySQLConnectionString("localhost", _
"test", _
"root", _
"", _
3306).AsString)
conn.Open()
Dim ucmd As MySQLUpdateCommand = New MySQLUpdateCommand(conn, _
New Object(,) {{"name", "原田 真由美"}, _
{"age", "33"}}, _
"emp", _
New Object(,) {{"id", "=", "4"}}, _
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
|