Reputation: 706
I have a DataTable dtEmployee
with one of the column is EmployeeId
.
I have an array of Integers with. I have to find all the values of array , that are not there in EmployeeId
column of DataTable dtEmployee
.
Upvotes: 1
Views: 601
Reputation: 223267
You can use Enumerable.Except
List<int> empIds = new List<int>(); //your employee Ids List
List<int> resultList = empIds.Except(dtEmployee .AsEnumerable()
.Select(r => r.Field<int>("EmployeeID"))
.ToList()).ToList();
Upvotes: 5