Error Check with linq

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 7
Joined: Wed 21 Jul 2010 17:34

Error Check with linq

Post by Partalakos » Wed 21 Jul 2010 17:54

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 ?

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 22 Jul 2010 16:19

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.

Post Reply