Your problem is that you try to compare arrays. You're right that the comparison is done by reference rather than by value. Either use another type like Tuple
, or use Join
(which is also probably faster than the Where
/Contains
combo):
Dim rows = from row in dt.AsEnumerable()
join e in exceptions on row(0) Equals e(0) And row(1) Equals e(1)
For Each row in rows
' do something '
Next