How to perform rollback from vb.net?

rollback , from , vb.net Villeurbanne, France
  • 9 years ago
    Hi, Please help me to perform rollback insert statement from vb.net. Thank You
  • 9 years ago
    Hi, I am not 100%, but i think you will need to use something like the transaction capabilities of the datacommands to undo the changes made by an insert statement. Not having used them too much and with a horrid bug in the transaction services for Oracle stopping me from going forward with them, i can't really guide more than point you in their direction. Sorry Si
  • 9 years ago
    You can use TransactionScope in .NET 2.0.... it's really simple: Using ts As New TransactionScope()     ' perform your database stuff here     ' complete the transaction         ' if you don't do this, you'll get the rollbacks you want     ts.Complete() End Using Hope that helps!
  • 9 years ago
    Hi, I have found the way to rollback the sql transaction from vb.net.This is how it is done. ' dim trns as sqlTransaction=myConnection.BeginTransaction dim Cmd as SqlCommand=............'Sql stmt Cmd.Transaction=trns Cmd.ExecuteNonQuery trns.commit Note:Rollback is performed in the catch block

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov