我是 vb .net 编程的新手,当我尝试将表单按钮连接到 MySql 数据库时遇到以下错误: System.Data.dll 中发生“System.ArgumentException”类型的未处理异常附加信息:不支持关键字。我一直在努力解决这个错误,但我没有成功。感谢您提供的任何帮助!请参阅以下课程的我的代码:
导入 MySql.Data.MySqlClient 公共类 Form1
Dim connect As New MySqlConnection
Dim connecto As String = "Server=localhost; User Id=root; Password; Database=sist"
Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
connect.ConnectionString = connecto
Try
connect.Open()
MessageBox.Show("Connected Successfully")
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label4.Text = Date.Now.ToString("MMM dd yyyy hh:mm:ss")
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)
End Sub
结束类