Update(DataSet, String) Method
Syntax:
public int Update(DataSet dataSet, string sourceTable)
Description:
Uses the associated InsertCommand, UpdateCommand or DeleteCommand properties for each inserted, updated, or deleted row in the specified DataSet for the specified table name.
Parameters:
dataSet
Type: System.Data.DataSet
The DataSet used to update the database.
sourceTable
Type: System.String
The name of the DataTable to update within the DataSet.
Return Value:
Type: System.Int32
The number of rows successfully updated from the DataSet.
Exceptions:
Exception | Condition |
---|---|
ArgumentNullException | The DataSet is invalid |
InvalidOperationException | The source table is invalid |
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[])