Submitting Changes

The DataSet object can submit data to the database in batch mode by using the data adapter’s Update method. Data can be submitted only on a per-table basis. When you call Update without specifying a table name, the code assumes a default name of Table. If no table exists with that name, an exception is raised. The Update method takes as arguments an instance of a DataSet object and a DataTable object, or a DataTable name. The Update method first examines the RowState property of each table row. Then it prepares and calls a tailor-made INSERT, UPDATE, or DELETE statement for each inserted, updated, or deleted row in the specified DataTable object. Rows are scanned and processed according to their natural order (their position ...

Get Building Web Solutions with ASP.NET and ADO.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.