Compare two columns in DT1 and DT2

Hi,

I have 2 data tables, DT1 and DT2 in which I have to compare two columns and get only the unmatched rows present in DT1 and not in DT2. Please let me know how to achieve the same.

PFB example for the same. Only the rows 6 and 7 from DT1 must be the output

image

image

Hi,

Hope the following helps you.

resultDt = DT1.AsEnumerable.Where(Function(r) not DT2.AsEnumerable.Select(Function(r2) r2("Customer_Ref").ToString).Contains(r("Cust_No").ToString)).CopyToDataTable()

Regards,