PC Review


Reply
Thread Tools Rate Thread

DataView.FindRows between two values?

 
 
michael.hodgson@gmail.com
Guest
Posts: n/a
 
      7th Dec 2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataView.FindRows out of range problem Rami Prilutsky Microsoft ADO .NET 2 18th Feb 2008 08:20 AM
DataView.FindRows out of range problem Rami Prilutsky Microsoft Dot NET 0 17th Feb 2008 06:31 PM
DataView.FindRows out of range problem Rami Prilutsky Microsoft C# .NET 0 17th Feb 2008 06:31 PM
RowFilter vs FindRows (DataView) =?Utf-8?B?Q2FsdmluIEtE?= Microsoft ADO .NET 3 20th Oct 2005 01:59 AM
Re: Can't bind to dataview.findrows result Bart Mermuys Microsoft VB .NET 0 24th Aug 2005 03:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 PM.