June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to ensure that DataAdapter changes are committed or rolled back as a whole.
Create a Transaction object, and assign it the DataAdapter commands that are used for deleting, updating, and inserting records.
The DataAdapter does not expose a Transaction property. However, the Command objects that the DataAdapter uses do provide this property. The following application shows how you can ensure that all commands in a DataAdapter update operation are grouped into a single transaction:
Dim Con As New SqlConnection(ConnectionString) Dim CmdSelect As New SqlCommand("SELECT * FROM Shippers", Con) Dim Ds As New DataSet() Dim Adapter As New SqlDataAdapter(CmdSelect) ' (Define the custom ...Read now
Unlock full access