And I want with LINQ get rows from DT1 that are in DT2 that is
But, if in DT1 there are no rows that are in DT2, then DT1 must be clear!!! Its important.
This LINQ from join work a very long time:
DT1 = (From x In DT1.AsEnumerable() where (From a In DT1.AsEnumerable() Join b In DT2.AsEnumerable() On a(“ID”).ToString() Equals b(“ID”).ToString() select a).Contains(x) select x).CopyToDataTable()
(From d1 in dt1.AsEnumerable
Where dt2.AsEnumerable.Any(Function (d2) d2("ID").toString.Trim.Equals(d1("ID").ToString.Trim))
Select r = d1).CopyToDataTable