I have multiple data tables(upto 28) in C# and I want to append all their columns in one data table(with data). Example: datatables are: DT1,DT2,DT3 and so on Number of Columns in these respective data tables: N1,N2,N3 and so on Output: One data table DT with total columns N1+N2+N3+... and all the data from the above data tables. Thanks. Edit: My tables have clustered primary keys.
var all = new DataTable();
all.Merge(DT1);
all.Merge(DT2);
all.Merge(DT2);
... better to use in a loop.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments