I have two data tables we need to get data from second data table. In primary data table we have ID and need to check in dt2 if it is match means pick the data and store in out put
DataTable lookup + outfiltering the non-present ones
OR
Join Datatable (Inner join) + post result
With LINQ we can do:
Build DataTable - Configure the 3 cols, ID, NAME, STATUS - dtResult
Assign Activity:
dtResult =
(From d1 in dt1.AsEnumerable
Join d2 in dt2.AsEnumerable
On d1("ID").toString.Trim Equals d2("ID").toString.Trim
Let ra = new Object(){d1(0), d1(1), d2("Status")}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable