Linq query for compair two datatable and get simmilar values in another data table

I have dt1 with student details and dt2 with only one column “Name”

Common column in both dt is “Name”

I want two fillter dt like if name of student available in DT2 we need consider it in DT3

For eg. If name John available in DT1 and DT2 “name” column we need to put that entire DT1 row in D3

#help #question

Assign Activity:
dtResult | DataType: DataTable =

(From d in dt1.AsEnumerable
Let n = d("Name").toString.Trim
Where dt2.AsEnumerable.Any(Function (d2) d2("Name").ToString.Trim.Equals(n))
Select r = d).CopyToDataTable

Also have a look on LookUp DataTable Activity

Join Datatable can also be used.

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