M
michael.hodgson
I am trying to quickly extract subsets of data from a dataset.
For example perhaps a date range, or where a string value lies between
A and M
I know that I can use A DataView.RowFilter for this, but having the
application build the index everytime a rowfilter is set expensive and
time consuming. Reading about it seems that FindRows makes use the the
DataView index (set via. sort) to match rows based upon a criteria.
However there seems to be no way of search for a range of data.
For example
DataView dv = new DataView(table,"Age",DataViewRowState.CurrentRows)
DataRowView[] drv = dv.FindRows("20");
works fine, but
DataView dv = new DataView(table,"Age",DataViewRowState.CurrentRows)
DataRowView[] drv = dv.FindRows(">20");
Fails,
and what I actually need is something like:
DataRowView[] drv = dv.FindRows(">20 AND < 30");
Any tips or suggestions greatly appreciated.
-Michael
For example perhaps a date range, or where a string value lies between
A and M
I know that I can use A DataView.RowFilter for this, but having the
application build the index everytime a rowfilter is set expensive and
time consuming. Reading about it seems that FindRows makes use the the
DataView index (set via. sort) to match rows based upon a criteria.
However there seems to be no way of search for a range of data.
For example
DataView dv = new DataView(table,"Age",DataViewRowState.CurrentRows)
DataRowView[] drv = dv.FindRows("20");
works fine, but
DataView dv = new DataView(table,"Age",DataViewRowState.CurrentRows)
DataRowView[] drv = dv.FindRows(">20");
Fails,
and what I actually need is something like:
DataRowView[] drv = dv.FindRows(">20 AND < 30");
Any tips or suggestions greatly appreciated.
-Michael