I have two datatables, in one of them old_DataTable
I have 3 results. In the other one called Output
I have 4 results. I have been implementing solutions suggested in forums:
Read the two
Datatables
drCommonRows = (From d1 In old_DataTable.AsEnumerable Join d2 In Output.AsEnumerable On d1("StartDate").toString.Trim Equals d2("StartDate").toString.Trim Select d1).ToList
drFilteredRows=old_DataTable.AsEnumerable.Except(drCommonRows, DataRowComparer.Default).toList
If drFilteredRows.Count >0 than dtFiltered drFilteredRows.CopyToDataTable Else dtFiltered old_DataTable.Clone
When testing it gives a good result of drCommonRows
but not of drFilteredRows
and in the IF condition it always goes in Else.
I even changed the : drFilteredRows=**old_DataTable**.AsEnumerable.Except(drCommonRows, DataRowComparer.Default).toList
into
drFilteredRows=**Output**.AsEnumerable.Except(drCommonRows, DataRowComparer.Default).toList
but in that case it gives as result all the datatable saved in Output
so gives 4 results and is not working.
> The result that I am expecting is 1 row that is the one which is
> different and is in the Output Datatable.