May 2002
Beginner
408 pages
9h 10m
English
The ADO.NET Connection object is used to work with transactions. As you'll see in the next few sections, the Connection object is used to initiate the transaction. Any command objects that need to enlist in the transaction are then assigned to the transaction. The transaction object itself is used to save, roll back, and perform other actions on the transaction.
In ADO.NET, you can start a database transaction by calling the BeginTransaction() method of the Connection object, as seen in Listing 18.1.
'Create Connection Dim conn as SqlConnection = new SqlConnection("Data Source=(local);" + "Initial Catalog=northwind;UID=sa;PWD=;") 'Create Command Dim cmd ... |
Read now
Unlock full access