tags:

views:

31

answers:

1

Hi,

Say I have this existing code:

datatable dt = new datatable();

for (i=0;i<...;i++)
{
 dt = ..\\gets the i'th datatable somehow.Note: all datatables share the same scheme.
 DoSomethingWithDt()
}
...

What I want, is that at the end of this routine I will have ONE DATATABLE with the same scheme as those above, except for an ADDITIONAL column called "id". This table will contain all rows from all tables, but all the rows of the original i'th datatable will have i as the value in the id column.

I have no idea how to achieve this, though it sounds doable..HOW?

10x!!

A: 

The simple answer is use the datatable.merge method. Look at this link - MSDN Datatable.merge method

Wade73

related questions