I have a datatable with two columns,
Column 1 = "EmpID"
Column 2 = "EmpName"
I want to query the datatable, against the column EmpID
and
Empname
.
For example, I want to get the values where
(EmpName != 'abc' or EmpName != 'xyz') and (EmpID = 5)
Something like this...
var res = from row in myDTable.AsEnumerable()
where row.Field<int>("EmpID") == 5 &&
(row.Field<string>("EmpName") != "abc" ||
row.Field<string>("EmpName") != "xyz")
select row;
See also LINQ query on a DataTable