RamHardikar
Programmer
DataSet Ds1 has undergone some updates on the column ‘Flag’. Am trying to create a DataView of only those rows which have the Flag value as ‘True’. Below is my code where i try to filter the required rows. Also am trying to get the row count of the DataView. But I always get the incorrect value or rather it always shows me the same rowcount as that of my DataSet ds1, which has 200 rows.
Why don’t I get the correct count even after I set rowfilter and rowstate filter on the DataView?
Code -
----------------------
dv1 = new DataView();
dv1.Table = ds1.Tables["People_Test"];
dv1.RowFilter = "flag = 'True'";
dv1.RowStateFilter = DataViewRowState.ModifiedCurrent;
dv1.Sort = "id Asc";
iDVRowCount = dv1.Table.Rows.Count;
----------------------
Why don’t I get the correct count even after I set rowfilter and rowstate filter on the DataView?
Code -
----------------------
dv1 = new DataView();
dv1.Table = ds1.Tables["People_Test"];
dv1.RowFilter = "flag = 'True'";
dv1.RowStateFilter = DataViewRowState.ModifiedCurrent;
dv1.Sort = "id Asc";
iDVRowCount = dv1.Table.Rows.Count;
----------------------