我的目标:使用visual basic向mysql数据库添加一列!
我尝试了多种方法,但这里是我目前正在使用的代码:
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
MysqlConn = New MySqlConnection
MysqlConn.ConnectionString = "Server=xxx.xx.xxx.xxx;Port=3306;Database=test;Uid=tester;Pwd=***"
Try
MysqlConn.Open()
Dim Query As String
Query = "ALTER TABLE user ADD test INT NOT NULL"
COMMAND = New MySqlCommand(Query, MysqlConn)
MysqlConn.Close()
Catch ex As Exception
End Try
End Sub
我认为这是查询的问题!感谢您的帮助! 这与ms sql不同,它是视觉基础。