Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataTable::Select Method (String^, String^, DataViewRowState)

 

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

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

public:
array<DataRow^>^ Select(
	String^ filterExpression,
	String^ sort,
	DataViewRowState recordStates
)

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.

recordStates
Type: System.Data::DataViewRowState

One of the DataViewRowState values.

Return Value

Type: array<System.Data::DataRow^>^

An array of DataRow objects.

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 and record state 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:
© 2017 Microsoft