I cant get my function to update more then one record at a time
this will work: UPDATE tableName SET field='blah1' WHERE id=1;
However this wont: UPDATE tableName SET field='blah1' WHERE id=1; UPDATE tableName SET field='blah2' WHERE id=2;
This is the function, Im thinking its to do with the executeNonQuery() method.
Public Function executeNonQuerySQL(ByVal statement As String, ByVal errorType As String, ByVal login As String) As Boolean
' open connection
' now we got here lets get another record count, this time on our list count!
dbDataAdapter.InsertCommand = New OdbcCommand
dbDataAdapter.InsertCommand.Connection = sqlConnection
dbDataAdapter.InsertCommand.CommandText = statement
' close connection
Catch ex As Exception
MsgBox(errorType & ControlChars.CrLf & ControlChars.CrLf & "statement: " & statement _
& ControlChars.CrLf & ex.Message, MsgBoxStyle.Exclamation, "Whoops!")
' and send error to IT
errorEmail(errorType & ControlChars.CrLf & ControlChars.CrLf & "statement: " & statement _
& ControlChars.CrLf & ex.Message, login)
It works fine for single updates, just not multiple. The same multiple record update command (the one compiled from my vb application) works fine when tried directly to mysql (through phpmyadmin), just not through VB net.