How to merge three data tables?

I want to merge three data tables DT1, DT2, and DT3 into a single data table.
All three data tables have a single column with the same column name


How about MergeDataTable activity as the following?



Yes, i was able to do this using merge data table activity
But the problem is I have to use extra merge data table activity every time there is an extra data table…
For example for 4 data tables i have to use 3 merge data table activities


I think ForEach mitigates your problem. How about the following?

OR the following LINQ expression might help you.

dtResult = {dt1,dt2,dt3}.SelectMany(Function(d) d.AsEnumerable.Select(Function(r) d.Clone.LoadDataRow({r(0)},False))).CopyToDataTable()


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.