I have two DataTables. I want to get what exists in the first one but does not exist in the second one. I would like the results in another DataTable. I would like to use LINQ.
- The First datatable:
DataTable dt1 = cc1roleDAL.GetAll(x, 0);
- The second datatable:
DataTable dt2 = cc1roleDAL.GetSpecific(x);
Note: the column names I return from the the two datatables:
-
crs_name -
name
This will do the trick for you:
or if you prefer query syntax:
You can then put the results into a DataTable by using the CopyToDataTable function: