System.Data.DataRowCollection.Add Method

Adds the specified System.Data.DataRow to the System.Data.DataRowCollection object.

Syntax

public void Add (DataRow row)

Parameters

row
The System.Data.DataRow to add.

Remarks

To create a new System.Data.DataRow, you must use the DataTable.NewRow method of the System.Data.DataTable class. When you use the DataTable.NewRow method, a new System.Data.DataRow object is returned using the schema of parent System.Data.DataTable. After you create the System.Data.DataRow object and set the values for each of its columns, use the DataRowCollection.Add(DataRow) method to add the object to the collection.

Generates an exception if the user generates an exception in the DataTable.RowChanging event. If an exception occurs, the row is not added to the table.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0