Hello,
I am having a problem with commit.
Here is the code where program stuck.
using (var transaction = DataEngine.Context.Database.BeginTransaction(IsolationLevel.ReadCommitted))
{
try
{
var createResult = DataEngine.Context.Customer_Modify(BusinessID, cutomerName,usermodified);
Logger.LogTrace(createResult.ToString());
await DataEngine.Context.SaveChangesAsync();
transaction.Commit();
}
catch (Exception ex)
{
Logger.LogTrace(ex.Message);
try
{
transaction.Rollback();
}
catch (Exception nex)
{
Logger.LogTrace(nex.Message);
throw;
}
throw;
}
}
After running the above code, I check the variable query and found an exception
The underlying provider failed on Open.
I've checked:
Connection between server and computer is normal
I can login to the database with username and password
I have checked the security settings in database (SQL Server) that permission has been granted .
I can able to 'Insert' records but not 'Update'
Why does this exception happen? I'm using .net 4.5
Thanks