try
{
string _conStr = "Driver={MySQL ODBC 3.51
Driver};server=localhost;database=test;uid=test;password=1;option=3";
OdbcConnection _odbcCon = new OdbcConnection(_conStr);
_odbcCon.Open();
OdbcTransaction trans = _odbcCon.BeginTransaction
(IsolationLevel.ReadCommitted);
OdbcCommand cmd = new OdbcCommand();
cmd.Connection = trans.Connection;
cmd.Transaction = trans;
string _sqlStr = "";
try
{
_sqlStr = "update test ....."
cmd.CommandText = _sqlStr;
cmd.ExecuteNonQuery();
_sqlStr = "";
}
catch
{
trans.Rollback();
_odbcCon.Close();
hidsysMsg.Value = "Saving Failed!";
return;
}
trans.Commit();
_odbcCon.Close();
}
catch (Exception e)
{
throw e;
}