Comparing two tables


I have a spreadsheet that has 2 sheets in it: first sheet contains the original data that needs to be processed; second tab contains the processed rows from sheet1. I need to find the records that have not been processed and place in the 3rd sheet.

The two sheets have different number of columns but will have two common columns in them: 1. account number; 2. last name.

How should I be able to do it?



How about the following?

arrDr = dt1.AsEnumerable.Where(Function(r) dt2.AsEnumerable.All(Function(r2)  (r2("account number").ToString<>r("account number").ToString AndAlso r2("last name").ToString<>r("last name").ToString))).ToArray

Note : arrDr is DataRow array. (10.1 KB)



The solution worked.

Thanks a lot!

1 Like

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