Compare two DataTables and remove duplicate rows


I have two datables ,One is main Table which has 100 rows and second is with 30 rows. Need to compare both the tables and remove the duplicate rows from main table which has 100 records. (100-30= 70)
Any leads helpful

Thank you

1 Like

Hi @Chaitan

Have you tried using the Join Data Table Activity.

NO! How that works?

1 Like

Join is giving the matching of records. I want to remove the records from datable

Use left join and after that remove rows which have empty values of second table by using the Filter Data Table Activity


You can use this also

outDT = dt1.AsEnumerable().Except(dt2.AsEnumerable(), DataRowComparer.Default).CopyToDataTable

check the attachment
Except.xaml (9.2 KB)

Thank you above solution worked

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