Trying to connect to and modify existing data in a MySQL table. The reading working fine but when trying to save a change, the following error occurs.
An error occurred while starting a transaction on the provider connection. See the inner exception for details. Inner exception message: Nested transactions are not supported.
Using MySQL Connector Net 6.4.3
Answer
I found an answer that works in my case. Add the code below to the datasource code
using System.Transactions;
namespace LightSwitchApplication
{
public partial class <ChangeThisToYourClassName>
{
private TransactionScope tx;
partial void SaveChanges_Executed()
{
tx.Complete();
}
partial void SaveChanges_Executing()
{
tx = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions {
IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted
});
}
}
}