Update(DataTable) Method

Syntax:

public int Update(DataTable dataTable)

Description:

Uses the associated InsertCommand, UpdateCommand or DeleteCommand properties for each inserted, updated, or deleted row in the specified DataTable.

Parameters:

dataSet

Type: System.Data.DataTable

The DataTable used to update the database.

Return Value:

Type: System.Int32

The number of rows successfully updated from the DataTable.

Exceptions:

Exception Condition
ArgumentNullException The DataSet is invalid
InvalidOperationException The source table is invalid
SystemException No DataSet exists to use as a source.
SystemException No DataTable exists to update.
SystemException No DataRow exists to update.
DBConcurrencyException An attempt to update the database resulted in zero records affected.

Reference:

For more information, reference MSDN documentation for: System.Data.Common.DbDataAdapter.Update(DataRow[])