How do you check individual SqlCommands ran during a SqlTransactions to see if they will run?
Posted
by Sam F
on Stack Overflow
See other posts from Stack Overflow
or by Sam F
Published on 2010-06-15T18:07:46Z
Indexed on
2010/06/15
18:12 UTC
Read the original article
Hit count: 208
I've been reading up on SqlTransactions and have found a great load of examples like: http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=451
The problem is, when I do a BeginTransaction() (Execute all the commands) and then Commit() at the end all the commands I execute get run and the ones with syntax errors or other errors just get skipped. This is where I would also like to run a roll back, not skip over them. I found a few articles on the subject but they were not very helpful and purely in SQL.
Is there any way to find out if one of the ExecuteNonQuery()'s failed before the commit and not just skipped? Thanks.
© Stack Overflow or respective owner