I want to compare table 1 with table 2 based on a specific column. Then copy the new data rows available in table 2 to table 1.
i am using below code.
table2.AsEnumerable().Where(function(row)
Not table1.AsEnumerable().Select(function(r) r.Field(Of Int32)(‘Email’)).Any(function(x) x = row.Field(Of Int32)(‘Email’))).CopyToDataTable()
But using this code if there any data in table1 but not in table 2 that is also coming. which should not.
Please help
dt2.AsEnumerable().Where(Function(row) Not dt1.AsEnumerable().Select(Function(r) r(“Col1”).toString).Any(Function(x) x = row(“Col1”).toString)).CopyToDataTable()
In this dt1 contains 10 to 14 numbers and dt2 contains 12,15