I am have a DATATABLE (lets say dtA) with 4,00,000 records. (one of the columns names is “score”.
Now I want to find the count of certain conditions.
Eg:- dtA.rows.count (where score is more than 5 and less then 15)
Also the.l count of dtA.rows.count (where Score is more than 16 and less then 35)
Also the count of dtA.rows.count (where score is more than 50 and less then 70)
Also the count of dtA.rows.count (where score is more then 80 and less then 100)
Now I know that it can be achieved using followed methods:-
- filter data table(using this 4 times for 4 lakh records)
“score” > “5”
Or score < 15, etc etc etc
for each row (using this 4 times for 4lakh records or using 4 if conditions in a single loop)
LiNQ (which I don’t know how. Inputs are welcome)
4)please add if there is some other option also.
I need an option which will take less execution time to get the counts of each condition since there are 4lakh (and ofcourse more than that records)…
Can also provide linQ to achieve this.
Thanks in advance,