Using Transactions—The Transaction Class

Transactions are the other operations that are handled partially by the Connection class. They are handled partially because in this version of ADO .NET, you only start transactions using the Connection class. Once a transaction is started, you keep it in a Transaction class object. The Transaction object is then used to commit or roll back the transactions.

Since we are using SQL Server for our database of preference, we will use SQL Client classes to demonstrate transactions. Create a project and name it ADOBook05-02. Alternatively, you can get the project from the CD if you don’t want to key in the code.

Add a grid control and five buttons to the form. Dock the grid to the top of the form. Name the ...

Get ADO.NET Programming in Visual Basic™ .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.