2010-09-02 5 views
0

hI ..!Linq à sql - left outer Rejoindre

Dim query = From c In cntxtNorthWind.Customers _ 
Join x In cntxtNorthWind.Orders On c.CustomerID Equals x.CustomerID into sr _ 
from b in sr.DefaultifEmpty() _ 
Select c.CustomerID, x.OrderID, x.ShipAddress 

Au-dessus de jointure externe gauche ne peut pas l'exécuter est dit « Fin de Statament attendu »

Répondre

0

Vous devez sélectionner un objet. Le moyen le plus simple de retourner un objet anonyme. (Je ne sais pas comment taper VB.net mais iC# il est):

... 
select new { c.CustomerID, x.OrderID, x.ShipAddress }; 

Croyez-est comme ça je VB.net:

... 
select New With { c.CustomerID, x.OrderID, x.ShipAddress } 
+0

merci mais j'ai besoin du code vb.net – Suhaibnm

+0

@Suhaibnm Est-ce que ça marche avec le code vb.net que j'ai ajouté? –

+0

pas toujours le même – Suhaibnm