Error Check with linq

Error Check with linq

Postby 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 ?
Partalakos
 
Posts: 7
Joined: Wed 21 Jul 2010 17:34

Postby 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.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for MySQL