System.Data.DataRowCollection.Find Method

Gets the row specified by the primary key value.

Syntax

public DataRow Find (object key)

Parameters

key
The primary key value of the System.Data.DataRow to find.

Returns

A System.Data.DataRow that contains the primary key value specified; otherwise a null value if the primary key value does not exist in the System.Data.DataRowCollection.

Remarks

To use the Find method, the System.Data.DataTable object to which the System.Data.DataRowCollection object belongs must have at least one column designated as a primary key column. See the DataTable.PrimaryKey property for more information about how to create a primary key column.

Requirements

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