I am new to VB.NET and as well as MySqL. I want to delete records in my database. Using,
Dim SQLStatement As String = "DELETE name,date FROM people"
RetrieveInfos(SQLStatement)
Where,
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
But there is an error of InvalidOperationException, I am confused. I want to delete records in my database without referencing the " WHERE number = VALUE " in order to delete the previous recorded value. Is that possible?
Any help would be appreciated. Thanks!