I have a DataTable which contains data in this format. I want to convert it to another format.
What is the simplest way to achieve this? maybe using lambda expression. I am using
C# 4.0
dattable1:
seq id Amt
=============================
1 00782 10
2 00782 20
3 00782 30
1 003850 40
2 003850 50
3 003850 60
1 005723 70
2 005723 80
3 005723 90
To be stored in another datatable or list in this format
1 00782 003850 005723 10 40 70
2 00782 003850 005723 20 50 80
3 00782 003850 005723 30 60 90
example 2
dattable1:
seq id Amt
=============================
1 00782 10
1 003850 40
1 005723 70
To be stored in another datatable or list in this format
1 00782 003850 005723 10 40 70
This will generate the input that matches what you asked for.
[Edit]
For “all scenarios”:
Output: