Hi everyone,
I have two datatables (‘dt_temp’ & ‘dt_comparison’) extracted from different Excel Files and want to compare them to find the (new) entries which only exist in dt_temp.
I tried using the Linq-Except Function based on several posts in this forum as:
dt_temp.AsEnumerable.Except(dt_comparison.asEnumerable,DataRowComparer.Default).CopyToDataTable()
As it did not work I merged the two tables and tried to remove all duplicate occurences with:
(From d In dt_temp.AsEnumerable()
Let cnt = dt_temp.AsEnumerable.Where(Function (r) d.ItemArray.SequenceEqual(r.ItemArray)).Count
Where cnt = 1
Select d).CopyToDataTable
However with both methods I received all values from dt_temp meaning the duplicates were not found.
I have checked manually and all values are the same - could this be a format or datatype issue? And if so, how can I check whether my datatable columns are the same format.
Thank you very much and best regards
Nico