I wonder how is it possible to manage transaction in c# code..
I have to do multiple insertion of same object with unique storedprocedure.
So I have to launch the same stored procedure with same parameters multiple times.
But if a problem appear in the process (lost connection,…) I don’t want just a part of insertions done and the rest failed, I want all the insertion cancelled.
So I would like a SQLtransaction but within the application code because a can’t change database.
I hope i’m clear enough and hope somebody can help me and push me on the good way..
Tx
You can call BeginTransaction on the SqlConnection before starting the work, and then CommitTransaction (or RollbackTransaction) at the end.
See MSDN reference here for example.