Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Can any one tell that how to filter datatable or seach from datatable.
Can Sql Queries be applied on DataTable
Regards.
Posted
Comments
sagar wasule 11-Jun-12 1:28am    
plz clarify ur question more , how do u want to filter the datatable ??

 
Share this answer
 
yes you can apply search and filter query to your datatable like that....
first create DataView for your Datatable then start filter and search criteria as per your requiremnets.

below the sample query.

filter through DataView

C#
DataView dv = dt.DefaultView;
dv.RowFilter = "AssetID>=1000000005 and AssetID<=1000000010";
dv.Sort = "AssetID desc";
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900