Grouping data at dataset level

  • Thread starter Thread starter Bravo
  • Start date Start date
B

Bravo

Hi,

I have a SP and I am getting data in a dataset.

The datatable in dataset is having 5 columns and out of 5
columns, data in 2 columns has composite unique value.
Now I have to group the data based on these two column's
value. Can anybody tell me how to do this??

I want to minimize the looping. A code sample would be
highly appreciated.

Thanks in advance

Bravo
 
Hi Bravo,

Err, what do you mean grouping by two columns?
If the combination of those two columns are unique then every row is a group
per se.
 
Hi Miha,
Sorry for the mis understanding

The data is in following fashion

col1 col2 col3 col.....
1 1 TEST
1 2 TEST
2 1 TEST
2 2 TEST
3 1 TEST
3 1 TEST
2 1 TEST

Hence I want to group these values by col1 and col2.

Could u tell me how to do this using dataset?

thanks
 
Hi,

Ah, I see.
I don't think that grouping at datatable or dataset level is supported in
any way.
However, you might do the following:
Create a dataview that sorts by col1, col2.
Now, they are ordered, so if you traverse them in a loop it should be easier
(just remeber last combination and if it changes -> new group).
Is this ok for you?
Do you need grouping at UI level?
 
Back
Top