Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi,

Kindly suggest solution on following problem. I have 3 SP(Stored Procedures) in code. If any of these fail, I want the error to be produced to the output. I want to know which transaction failed and what happened, before roll back.
Note: We can't do any changes in SQL server's SP, have to provide some functionality in C# code only.

Code is :

C#
try
{
    SP1 with A output
    SP2 with B output
    SP3 with C output
}
catch (Exception ex)
{
  //exception
}



Thanks,
AVINCODE
Posted
Updated 23-Sep-13 1:09am
v2
Comments
Thanks7872 23-Sep-13 7:07am    
Than commit changes only after you be sure about output of the SP.

1 solution

Use transaction provided by .net see the link for reference

http://stackoverflow.com/questions/224689/transactions-in-net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900