MySqlScript within a transaction
Posted by: David Thome
Date: October 13, 2021 11:52AM

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();
}

Options: ReplyQuote


Subject
Written By
Posted
MySqlScript within a transaction
October 13, 2021 11:52AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.