jdhackett
asked on
Count rows in filtered datatable
I have a Data Table, dtAgedDebt. It has 52 rows.
If I apply a filter to it, how would I get the number of filtered rows?
For example:
? dtAagedDebt.DefaultView.Ro wFilter
"AgeOfDebt >= 120"
? dtAgedDebt.Rows.Count
52
There are only 8 rows that meet the filter requirements - how would I find them and get the count?
Thanks
If I apply a filter to it, how would I get the number of filtered rows?
For example:
? dtAagedDebt.DefaultView.Ro
"AgeOfDebt >= 120"
? dtAgedDebt.Rows.Count
52
There are only 8 rows that meet the filter requirements - how would I find them and get the count?
Thanks
ASKER
Em, no that won't work.
I take it that your smileys meant you knew this!
I take it that your smileys meant you knew this!
ASKER
Still stuck on this. Anyone got a solution?
Is your datatable show in a datagridview or anything? Are you using dataviews?
ASKER
No, its not. I need to so some calculations on the filtered rows, and just need to count them.
How would a dataview help?
How would a dataview help?
I just wondered how you filter the data?
I'm assuming you want to look at the data table and just count the number of rows which meet the criteria?
I'm assuming you want to look at the data table and just count the number of rows which meet the criteria?
ASKER
I filter using:
stFilter = "AgeOfDebt >= 90"
dtAgedDebt.DefaultView.Row Filter = stFilter
stFilter = "AgeOfDebt >= 90"
dtAgedDebt.DefaultView.Row
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dtAagedDebt.DefaultView.Ro
;) ;)