we can mention the column index that usually starts from 0 for the first column
based on which we can just mention the column index without double quotes like this
Datatable Out_NonMatched_Data = DTPart.AsEnumerable().Where(function(row) Not DTFull.AsEnumerable().Select(function(r) r.Field(Of String)(columnindex)).Any(function(x) x = row.Field(Of String)(columnindex))).CopyToDataTable()
Code is:
DTPart.AsEnumerable().Where(function(row) Not DTFull.AsEnumerable().Select(function(r) r.Field(Of String)(0)).Any(function(x) x = row.Field(Of String)(0))).CopyToDataTable()
As you mentioned finding the Common rows we’re Not the Problem at your so end. So in the xamls you will find on how to use the commmons rows to identify the unmatching rows
@Asanka
(From d1 In DTFull.AsEnumerable ← looping over DTFull
Join d2 In DTPart.AsEnumerable ← looping over DTPart
On d1(0).ToString Equals d2(0).ToString ← Checks if both rows are matching the join clause
Select d2).CopyToDatatable ← selects from the matches the d2 row
all d2 are copied to a datatable
dtfull.AsEnumerable().Except(dtfinal.AsEnumerable(),DataRowComparer.Default).CopyToDataTable()
is working via so called set operations
all rows from dtfull are taken as long these rows are not present in dtfinal, also called the minus operation
@Asanka
Statement from @Palaniyappan and that one from my referenced XAML (see link from my post) are close and similar in the meaning. What can happen is that the except statement is returning no rows, e.g there are no uncommon rows. then CopytoDataTable is throwing an exeception. Have a look on the post/on my xaml on how to save up this part with checking the row count and only using copytodatatable if rows are returned.