Adding datatable columns
Posted on 2015-02-24
I after some help with logic. I start off with a datatable that looks like this (in reality it may have more of less columns)
Col1 Col2 Col3
I then have another datatable which could have any number of rows (for this example I’ll assume it has 3 rows)
I need some mechanism of looping through the columns in the first datatable and for each row in the 2nd table insert corresponding columns. The tricky part is the order; the first datatable must look like this when finished:
Col1 NewCol1 NewCol2 NewCol3 Col2 NewCol1 NewCol2 NewCol3 Col3 NewCol1 NewCol2 NewCol3
I had some success using the set ordinal method buts it not right. Hoping a fresh pair’s eyes on the problem will help me out.