Hi,

I would like to execute a batch update (mysql) with C#. How do I do
that?

For example,


OdbcCommand cmd = New OdbcCommand();
Cmd.Connection = Conn;
cmd.CommandText = "UPDATE stockin SET Out = 0 WHERE ID = 11;"
cmd.CommandText += "UPDATE stockout SET Returned = 1 WHERE ID =
53;"
OdbcTransaction trans = Conn.BeginTransaction();
Cmd.Transaction = trans;
try
{
Cmd.ExecuteNonQuery();
trans.Commit();
return true;
}
Catch(Exception ex)
{
trans.Rollback();
MessageBox.Show(ex.Message.ToString());
}

I get this error :

ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.17-nt]You have
an error in your SQL syntax. Check the manual that corresponds to
your MySQL server version for the right syntax to use near '; UPDATE
stockout SET Returned = 1, ReturnedOn = NOW(), Returne

I have tried using MySQL administrative tools (MySQL Front) to
test batch transactions and it doesn't give me any error.


Please help me. Thank you!