System.Data.DataTable.NewRow Method

Creates a new System.Data.DataRow with the same schema as the table.

Syntax

public DataRow NewRow ()

Returns

A System.Data.DataRow with the same schema as the System.Data.DataTable.

Remarks

You must use the DataTable.NewRow method to create new System.Data.DataRow objects with the same schema as the System.Data.DataTable. After creating a System.Data.DataRow, you can add it to the System.Data.DataRowCollection, through the System.Data.DataTable object's DataTable.Rows property. When you use DataTable.NewRow to create new rows, the rows must be added to or deleted from the data table before you call DataTable.Clear.

Requirements

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