Page 1 of 1

Error Check with linq

Posted: Wed 21 Jul 2010 17:54
by Partalakos
Hello Everyone.

Fist Question : well lets say that i have 2 queries to execute, i want (if it is possible) to rollback the changes from the 1st query if the second query fail.

Second Question : Is there any way to check if the query finish with errors ?

Posted: Thu 22 Jul 2010 16:19
by AndreyR
You can use either the DataContext.Transaction property to use a local ADO.NET transaction or the TransactionScope instance to make the code block transactional. In the first case do not forget to open the DataContext.Connection instance, this will ensure that there will be no pooling issues.