我是 VB.NET 和 MySqL 的新手。我想删除数据库中的记录。使用,
Dim SQLStatement As String = "DELETE name,date FROM people"
RetrieveInfos(SQLStatement)
在哪里,
Public Sub RetrieveInfos(ByRef SQLStatement As String)
Dim cmd As MySqlCommand = New MySqlCommand
With cmd
.CommandText = SQLStatement
.CommandType = CommandType.Text
.Connection = SQLConnection
.ExecuteNonQuery()
End With
SQLConnection.Close()
SQLConnection.Dispose()
End Sub
但是有一个InvalidOperationException的错误,我很困惑。我想在不引用“ WHERE number = VALUE ”的情况下删除数据库中的记录,以删除以前记录的值。那可能吗?
任何帮助,将不胜感激。谢谢!