In M code, I am getting an error, "This SqlTransaction has completed; it is no longer usable." The line of code that is generating this code is this sqlTransaction
MSSqlConnectionHandler.CommitTransaction();
This CommitTransaction function is
public static void CommitTransaction()
{
try
{
_theTran.Commit();
}
catch (Exception Ex)
{
try
{
_theTran.Rollback();
}
catch (Exception InnerEx)
{
throw InnerEx;
}
throw Ex;
}
}
But, I Comment out this MSSqlConnectionHandler.CommitTransaction(); line, then no error occured but no data is saved either. What's going wrong, What should I provide here to make it more clear? Thanx in advance