Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RowFilter and Dates
Message
 
To
24/05/2004 13:09:32
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00906425
Message ID:
00906621
Views:
12
OK, thanks. That does make sense.

>Chris,
>
>This isn't a problem, this is the way DataViews are supposed to work. myDataView.Table points back to the table and so by definition it's Rows.Count will give you *all* the rows in the table, not just the filtered rows and that's why you had to use myDataView.Count.
>
>~~Bonnie
>
>
>>I had a problem a couple weeks ago concerning DataViews that I meant to post, but forgot. I created a DataView from a DataTable in a DataSet and kept thinking that the DataView wasn't actually filtering the data. It was filtering the data, but I was using:
>>
>>myDataView.Table.Rows.Count
>>
>>to see how many records were in the DataView. It turns out this doesn't work. That property holds the count of the records as if a filter hadn't been applied. I had to use:
>>
>>myDataView.Count
>>
>>Has anyone else run into this?
>>
>>>I am trying to set a filter on a dataview to show all animals over 18 months. Here is the code I have tried.
>>>
>>>
>>>this.AnimalsVw.RowFilter = "Dob < #" + DateTime.Today.AddMonths(-18) + "#" ;
>>>
>>>
>>>and I have also tried
>>>
>>>
>>>this.AnimalsVw.RowFilter = "Dob < '" + DateTime.Today.AddMonths(-18) + "'" ;
>>>
>>>
>>>Neither on the filters works either causing an error or just not filtering any animals.
>>>
>>>I am using C# and the compact framework.
>>>
>>>Thanks for any pointers.
>>>
>>>John
Chris McCandless
Red Sky Software
Previous
Reply
Map
View

Click here to load this message in the networking platform