Datatable comparision -- between two DTs and get the common records

in general it is a Match case. We can model it with the Any Approach (did not use innerjoin as we dont want to get confuced by duplicated personal nos)

dtResult =

(From d in dt2.AsEnumerable
Let cv = d("Personal no").toString.Trim
Where dt1.AsEnumerable.Any(Function (x) x("Personal no").toString.Trim.Equals(cv))
Select r = d).CopyToDataTable

Handling empty results:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

1 Like