我是 vb.net 中的 Mysql 新手。
我想要的是当我单击保存按钮时,我希望更新 mysql 数据库并且更新列 Wcoins,它将获得 Label2.Text 中的值
我的代码:
Dim conn As MySqlConnection
conn = New MySqlConnection("server=REMOVED;Port=REMOVED; user id=REMOVED; password=REMOVED; database=REMOVED")
Dim username As Boolean = True
conn.Open()
Dim sqlquery As String = "UPDATE * FROM NewTable WHERE Wcoins=label2.text"
Dim data As MySqlDataReader
Dim adapter As New MySqlDataAdapter
Dim command As New MySqlCommand
command.CommandText = sqlquery
command.Connection = conn
adapter.SelectCommand = command
data = command.ExecuteReader
data.Close()
conn.Close()
我犯了一些错误,但我试图更新 Wcoins,所以它会删除旧值并获得 label2.text 中显示的值
任何帮助都会非常感激
我是荷兰人所以如果你看到拼写错误请纠正他们