Click here to Skip to main content
15,922,407 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,
I am getting an error :
'trans.IsolationLevel' threw an exception of type 'System.InvalidOperationException'

What I have tried:

What I am trying to do is, getting data from user... storing it in clonedt and updating it to sourcedt. Which is then updated to a table in database.

sourceDt.Merge(clonedDt, false, MissingSchemaAction.AddWithKey);
trans.Commit();

The code is running without any breaking, even tho its showing isolation error. But data is not updated in database table.

Below image of error
[^]
Posted
Updated 1-Jan-18 14:40pm
v2

1 solution

The most likely answer is due to the IsolationLevel property.
The default value is; Serializable - Volatile data can be read but not modified & no new data can be added during the transaction
Use your debugger & check the trans.IsolationLevel value, especially if you have done a read without committing the transaction & then attempting to update.

Link to MSDN System.Transactions.IsolationLevel documentation below;
IsolationLevel Enumeration (System.Transactions)[^]

Kind Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900