Update(DataRow[]) Method
Syntax:
public int Update(DataRow[] dataRows)
Description:
Uses the associated InsertCommand, UpdateCommand or DeleteCommand properties for each inserted, updated, or deleted row in the specified array of DataRow objects.
Parameters:
dataRows
Type: System.Data.DataRow[]
An array of DataRow objects used to update the database.
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 |
SystemException | The specified 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[])