Visual Basic and SQL Server Commit Transaction


All replies

  • Is it really that hard to look for documentation? ;)


    Friday, February 08, 2013 9:20 AM
  • Andrew I am new at this so bare with me.  It seams the link you send is speaking about scope when a user is connected to two databases.  I need to know how to commit a SQL Server transaction in VB after I do a SQL delete.  Please send code.  This is my problem.  I am using VB listvew and I delete an entry on the screen and my code then delete the entry from Sqlserver.  Without getting out of the listview I delete the second entry.   Then when I do a select only the last delete took place in the sqlserver.


    Friday, February 08, 2013 10:25 AM
  • Ed,

    If you don't use a .Net transaction or the Entity framework (and the way you write it I guess you don't and are you using the word transaction like a command) there is no commit. Not in SQL server and not in .Net.

    After an command, the command is processed by SQL Server.



    Friday, February 08, 2013 12:26 PM
  • Are you talking about transactions set through the SqlCLient.SqlConnection class?  If so this link has an example of the pattern for beginning, committing and rolling back a transaction.


    Friday, February 08, 2013 5:01 PM
  • Thanks, that is the info I needed.   I think you very much


    Friday, February 08, 2013 10:09 PM