System.Data.DataTable.Select Method

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

Syntax

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

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.

Returns

An array of System.Data.DataRow objects matching the filter expression.

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