O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

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

Submitting Updates Using a SqlDataAdapter

The SqlDataAdapter class’s Update method covers all the items from the preceding list.

Create a procedure (or function) that accepts multiple DataRows

The Update method is overloaded. You can pass in a DataTable or an array of DataRows. You can also pass in a DataSet; however, the SqlDataAdapter will submit the pending changes stored in just one DataTable.

Look for DataRows that contain pending changes

The Update method walks through the DataRows submitted, checking each DataRow’s RowState property.

Access a SqlCommand that contains the updating logic that corresponds to the DataRow’s RowState property

The SqlDataAdapter class exposes properties—InsertCommand, UpdateCommand, and DeleteCommand—to store this updating ...

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