I need to join two diferent datatables with one column in common. I need almost all columns from one, and all columns from another. Im trying with groupJoin Lambda, but i can get it. It trows an anonimous object, how can i get a datarow to add it to the output datatable?
query
dtUno.AsEnumerable.GroupJoin(dtDos.AsEnumerable, Function(lef) lef(“id”), function(rig) rig(“id”), function(lef, rig) new With {.id = lef, .key = rig } )
dt1
id fecha precio tamaño
1 2024 56$ xxl
2 2024 86$ xl
3 2024 76$ l
dt2
id provedor sku tienda
1 mkp 45632 izcalli
2 rko 48632 portobello
3 lok 75632 puebla
Output
id fecha precio tamaño provedor sku
1 2024 56$ xxl mkp 45632
2 2024 86$ xl rko 48632
3 2024 76$ l lok 75632
thanks for the reply, but this can also be done in linq querysh using an assign activity, but the real dts are way more larger, like 30 and 45 columns. So its kinda complicated to build that output datatable. So im searching a lambda linq solution.
If the example is a true representation of the datatables in context of the amount of columns, then you could perhaps use the built-in activities for Join data table and Remove data column for the columns you dont want.
Alternatively use Filter data table (after joining) with your desired output columns defined.
If the amount of columns is very large then this of course explains why you would look for another solution.