G
geeksgk
This issue is really frustating because it happens randomnly.
This is the sample layout of my code.
try
{
SQLConnection.Open();
trans = SQLConnection.BeginTransaction();
//Insert the data into tables using datasets
trans.Commit();
}
Catch (SqlException ex)
{
Console.WriteLine(ex.Message);
trans.Rollback();
}
Randomnly I get the error "This sqlTransaction has completed; it is no
longer usable". This error occurs when it tried to execute
"trans.Commit();"
Anyone has any suggestions?
Thanks
This is the sample layout of my code.
try
{
SQLConnection.Open();
trans = SQLConnection.BeginTransaction();
//Insert the data into tables using datasets
trans.Commit();
}
Catch (SqlException ex)
{
Console.WriteLine(ex.Message);
trans.Rollback();
}
Randomnly I get the error "This sqlTransaction has completed; it is no
longer usable". This error occurs when it tried to execute
"trans.Commit();"
Anyone has any suggestions?
Thanks