I am having a few problems quering a DataSet.Tables[0] and removing rows that do not meet the critira of a List.
//This is my list
var values = new List<string> {"Test", "Test2"};
// Now I just query the DataSet for anything that doesnt match this list
var query = from x in ds.Tables[0].AsEnumerable()
from b in values
where !x.Field<string>("ColumnName").Contains(b)
select x;
This works and returns the results but it is returning 2 x sets of the same rows (I assume because there is no join).
How can I just get Distinct values of these rows?
It sounds like you probably want:
In other words, find all the rows where the “ColumnName” field value isn’t present in any of the values in
values.