Help to remove rows in datatable if they match value in a second datatable

Hi @kkiw

You can use the Assign activity with the following LINQ query

dtOutput=io_dtInactiveUsers.AsEnumerable().Where(Function(row) NOT dtExclusion.AsEnumerable().Any(Function(x) x(“ID”).ToString=row(“ID”).ToString)).CopyToDatatable;

  • The dtOutput fetches data from io_dtInactiveUsers which are not in dtExclusion based on ID column (assumed that in both of these datatables ID is the common column to be matched)

Note : If by chance you get “ AsEnumerable is not a member of datatable ” issue then this link will help you to fix: AsEnumerable is not a member of ‘System.Data.Datatable’ - #2 by loginerror

Thanks
Vishal

4 Likes