DataTable.Select Method (String, String)

 

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

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

member Select : 
        filterExpression:string *
        sort:string -> DataRow[]

Parameters

filterExpression
Type: System.String

The criteria to use to filter the rows. For examples on how to filter rows, see DataView RowFilter Syntax [C#].

sort
Type: System.String

A string specifying the column and sort direction.

Return Value

Type: System.Data.DataRow[]

An array of DataRow objects matching the filter expression.

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

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

The following example uses a filter expression to return an array of DataRow objects.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: