Tim Riley
unread,Dec 5, 2007, 2:22:19 PM12/5/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,
I have a situation where I need to take multiple DataTables and
convert them to a single Datatable which would be simple if I didn't
need to convert them into a matrix where like items will be combined.
For example say I have 3 DataTables like so:
Note all three datatables have the same fields. They are:
Qty, CatalogNo, Part, Description, length, width
DataTable1 with comma seperated field values:
1, Q123456, 01, Limit Switch, 0, 0
1, E654321, 02, 1/2" Bolt, 0, 0
8, F786543, 03, 3/4" Bolt, 0, 0
1, P967349, 04, 1/2" Stainless Plate, 13, 14
1, P967349, 05, 1/2" Stainless Plate, 123, 48
DataTable2 with comma seperated field values:
1, Q123456, 01, Limit Switch, 0, 0
1, E654321, 02, 1/2" Bolt, 0, 0
8, F786543, 03, 3/4" Bolt, 0, 0
1, P967322, 04, 1/2" Carbon Plate, 13, 14
1, P967322, 05, 1/2" Carbon Plate, 123, 48
DataTable3 with comma seperated field values:
1, Q123456, 01, Limit Switch, 0, 0
3, E654321, 02, 1/2" Bolt, 0, 0
8, F786543, 03, 3/4" Bolt, 0, 0
1, P967349, 04, 1/2" Stainless Plate, 13, 14
1, P967349, 05, 1/2" Stainless Plate, 123, 48
These tables would be then converted into a table with the fields:
Qty03, Qty02, Qty01, CatalogNo, Part, Description, length, width
And have the comma seperated field values of:
1, 1, 1, Q123456, 01, Limit Switch, 0, 0
3, 1, 1, E654321, 02, 1/2" Bolt, 0, 0
8, 8, 8, F786543, 03, 3/4" Bolt, 0, 0
1, 0, 1, P967349, 04, 1/2" Stainless Plate, 13, 14
0, 1, 0, P967322, 04, 1/2" Carbon Plate, 13, 14
1, 0, 1, P967349, 05, 1/2" Stainless Plate, 123, 48
0, 1, 0, P967322, 05, 1/2" Carbon Plate, 123, 48
I realize this isn't really clear but I hope someone can follow what
I'm trying to do. I'll take any help I can get.
Thanks,
Tim