What is the c# code to MySqlScript in a transaction?
I have this code but it does not execute within a transaction.
MySqlConnection MySQLConn = new MySqlConnection("server=xx.xx.xx.xx;User=user;database=mydb;port=3306;password=xxxx;");
MySQLConn.Open();
MySqlTransaction MySQLConnScriptTrans;
MySQLConnScriptTrans = MySQLConn.BeginTransaction();
try
{
MySqlScript MySQLConnScript = new MySqlScript(MySQLConn, SQL);
MySQLConnScript.Execute();
MySQLConnScriptTrans.Commit();
}
catch (Exception ex)
{
MySQLConnScriptTrans.Rollback();
}
I have this code but it does not execute within a transaction.
MySqlConnection MySQLConn = new MySqlConnection("server=xx.xx.xx.xx;User=user;database=mydb;port=3306;password=xxxx;");
MySQLConn.Open();
MySqlTransaction MySQLConnScriptTrans;
MySQLConnScriptTrans = MySQLConn.BeginTransaction();
try
{
MySqlScript MySQLConnScript = new MySqlScript(MySQLConn, SQL);
MySQLConnScript.Execute();
MySQLConnScriptTrans.Commit();
}
catch (Exception ex)
{
MySQLConnScriptTrans.Rollback();
}