I have a dataset as below. I want to iterate through the dataset
comparing the value of the Code column to the value in the previous
row. If they are the same then I want to concatenate the value of the
Desc column in my current row to that of the value in the previous row.
If the value of Code is different to the value in the previous row then
I want to output the row to a dataset. I managed to achieve this
functionality but in a very messy way I'm sure there must be a more
elegant solution to what I have come up with.
Can anyone come up with a simple algorithm to solve this?
Input dataset
ItemNum Code Desc
1 A Apple
2 A Cider
3 A Scrumpy
4 B Strawberry
Resulting dataset
Code Desc
A Apple Cider Scrumpy
B Strawberry
Joe
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com