更新mysql查询不更新表,只删除指定字段中的数据

更新mysql查询不更新表,只删除指定字段中的数据,mysql,asp.net,vb.net,odbc,Mysql,Asp.net,Vb.net,Odbc,我的更新查询有问题,它不是更新指定的字段,而是删除它们 以下是查询: Dim myConnection As OdbcConnection Dim myCommand As OdbcCommand myConnection = New OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};Database=usermanagement;Server=localhost;UID=root;") myConnection.Open() If myCon

我的更新查询有问题,它不是更新指定的字段,而是删除它们

以下是查询:

Dim myConnection As OdbcConnection
Dim myCommand As OdbcCommand


myConnection = New OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};Database=usermanagement;Server=localhost;UID=root;")
myConnection.Open()

If myConnection.State = 0 Then
    myConnection.Open()
End If


myCommand = New OdbcCommand("update rooms set rmname='" + Request.Form("rmnames") + "',description='" + Request.Form("description") + "', rmprice='" + Request.Form("rmprices") + "' where room_id='" + Request.Form("rooms_id") + "'", myConnection)
myCommand.ExecuteNonQuery()
myConnection.Close()

Response.Redirect("admin.aspx")
谢谢你的帮助

Dim myConnection As OdbcConnection
Dim myCommand As OdbcCommand


myConnection = New OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};Database=usermanagement;Server=localhost;UID=root;")
myConnection.Open()

If myConnection.State = 0 Then
    myConnection.Open()
End If

myCommand = New OdbcCommand("update rooms set rmname='" + Request.Form("item") + "',description='" + Request.Form("descr") + "', rmprice='" + Request.Form("rate") + "' where room_id=" + Request.Form("room_id"), myConnection)
myCommand.ExecuteNonQuery()
myConnection.Close()

Response.Redirect("admin.aspx")

这是我的回答

我要求您提供代码,因为这可能是一些原因Shello先生,我能够解决,谢谢您的回复。如果您已经解决了问题,请添加一个答案并接受它。这样我们就不会浪费时间阅读你的问题,而只是发现你不再需要帮助。同样,有同样问题的其他人也可能会受益。如果它解决了你的问题,请接受它,如果你提到使你的问题变得重要的事情,那就太好了resolved@coder他删除了WHERE子句中ID列旁边的单个配额标记。我没想到Odbc不能解决这个问题。。。在Sqlcommand中,ID=5和ID='5'等于。。。