O'Reilly logo

Essential ADO.NET by Bob Beauchemin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.7. How Update Works

Calling the DbDataAdapter.Update method triggers a series of steps to update the database with changes made to the object specified (DataTable, on a per-row basis). The sequence of events is as follows:

1.
The values in the DataRow are moved to the parameter values.
2.
The OnRowUpdating event is raised.
3.
The command executes.
4.
If the command is set to FirstReturnedRecord, then the first returned result is placed in the DataRow.
5.
If there are output parameters, they are placed in the DataRow.
6.
The OnRowUpdated event is raised.
7.
AcceptChanges is called.

5.7.1. Controlling Updates

The DataAdapter.Update method, when applied to a DataSet, applies inserts, updates, and deletes in a predefined order. Sometimes, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required