DataView.FindRows between two values?

  • Thread starter michael.hodgson
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top