i have dataset that contains rows
MyTbl
=====
Name | Age
----------
aa | 23
bb | 90
cc | 2
dd | 1
ee | 14
i need to fill datagrid with all rows that the age > 5
aa | 23
bb | 90
ee | 14
i try this:
dataGrid1.DataSource = Main.dsParts.Tables[1].DefaultView.RowFilter = "Age > 5";
and this:
dataGrid1.DataSource = Main.dsParts.Tables[1].Select("Age > 5");
but it not work !, how to do it ?
thanks in advance
Try this:
The
RowFiltersets the condition, but just setting it doesn’t return a new view to display; but from that point on, the.DefaultViewwill contain only those rows that match that criteria.