Reputation: 1391
Im trying to query a datatable using linq, ideally what I would like to do is compare a column of strings to an array of strings, returning those that match.
Any ideas?
Cheers in advance
CM
Upvotes: 1
Views: 142
Reputation: 57783
You need to use one of the Field<T>
methods of DataRowExtensions.
var foo = from r in dt.AsEnumerable()
where bar.Contains(r.Field<string>("barColumn"))
select r;
Upvotes: 3