Bit rusty on my VB syntax but here goes
first off, there is a better way to put your SQL:
SELECT *
FROM Table1 t1
Where not exists (
select * from Table2 t2
Where t1.DealReference = t2.DealReference
)
This minimises the content scanned so is much more efficient. That in mind you can create linq queries that reflect this logic
public function ByExtensions()
var result = db.table1.Where(t1=>!db.table2.Any(t2=>t2.DealReference==t1.DealReference))
end function
public function NonExtensions()
var result = from t1 in db.table1
where !(from t2 in db.table2
select t2.DealReference)
.Contains(t1.DealReference)
select t1
end function
The inline (NonExtensions) method could well be wrong and look inefficient to me. If you are using 4.0 then stick with the ByExtentions menthod. If not then let me know and I'll have another go
Good Luck ^_^