I need to traverse through a sharepoint list and get a count of some of the column values. for eg, in office(col1), if Name(Col2), Smith(Val2) is present twice then
the count=2.
I have to create a webpart that displays these counts. It looks something like this:
Name AsFirstName AsMiddleName AsLastName
Smith 0 4 1
Samantha 3 1 500
Raj 2 0 4
I have two approaches: Using nested looping with SPQUERY to get the counts.
OR
Using nested looping to get all the row value in a GENERIC LIST and then getting counts.
which one would be better approach in terms of readablity,performance,maintainability......overall?
Use Generic List to get all values and then you can do all operations on it locally, without having to hit server again. All Linq operations are also possible this way.