2009-03-09 15 views

risposta

6

penso che questo funzionerà (si prega di adattarsi alle vostre DataSet):

var query = from c in T1 
      where !(from o in T2 select o.CustomerID) 
      .Contains(c.CustomerID) 
      select c; 
+0

Wow - E 'stato semplice! Grazie per l'aiuto – Rick

1

Hai solo bisogno di noi una clausola WHERE e tutti:

T1.Where(item1 => T2.All(item2 => item1.ID != item2.ID)); 
+0

Sembra che avrebbe funzionato anche! Grazie per l'aiuto. – Rick

7

Questo richiede un outer join e un assegno su null.

var result = from c in Customers 
      join d in Details on d.CustomerID equals c.ID into g 
      where !g.Any() 
      select c; 
+0

Questo sembra essere più veloce della risposta accettata – Stefanvds

Problemi correlati