How to: Filter and Sort Data
You filter data by setting theproperty to a string expression that returns the desired records.
You sort data by setting theproperty to the column name you want to sort on; append DESC to sort in descending order, or append ASC to sort in ascending order.
If your application does not usecomponents, then you can filter and sort data using objects. For more information, see .
To filter data using a BindingSource component
Set the Filter property to the expression you want to return. For example, the following code returns customers with a CompanyName that starts with "B":
To sort data using a BindingSource component
Set the Sort property to the column you want to sort on. For example, the following code sorts customers on the CompanyName column in descending order: