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.

DataView::Sort Property

 

Gets or sets the sort column or columns, and sort order for the DataView.

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

public:
property String^ Sort {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

A string that contains the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas.

If you do not explicitly specify sort criteria for DataView, the DataRowView objects in DataView are sorted based on the index of its corresponding DataRow in the DataTable.RowsDataRowCollection.

For more information, see DataViews.

The following example instructs the DataView to sort the table by two columns.

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