System.Data.DataTable.Select Method

Gets an array of all System.Data.DataRow objects that match the filter in the order of the sort that match the specified state.

Syntax

public DataRow[] Select (string filterExpression, string sort, DataViewRowState recordStates)

Parameters

filterExpression
The criteria to use to filter the rows. For examples on how to filter rows, see tp://www.csharp-examples.net/dataview-rowfilter/.
sort
A string specifying the column and sort direction.
recordStates
One of the System.Data.DataViewRowState values.

Returns

An array of System.Data.DataRow objects.

Remarks

To form the filterExpression argument, use the same rules for creating the System.Data.DataColumn class's DataColumn.Expression property value. The Sort argument also uses the same rules for creating class's DataColumn.Expression strings.

If the column on the filter contains a null value, it will not be part of the result.

Requirements

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