I have some piece of code in my Website which adds the details into tables. Now I want that if some error occurs the previously entered data should be removed. How can I implement it with the help of transactions??
From stackoverflow
-
We need more details such as what database you are using and so forth. Basically you do this:
Create a transaction
Do some work in the context of that transaction
Do some more work in the context of that transaction
...
If an exception occurred, rollback the transaction, else commit.
Roshan : I am using SQL Server 2005 database. I am writung the code in C#Sam Saffron : Look at SqlTransaction
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.