In C# do they both work? What exception are you getting?
Giacomo On Thu, Apr 9, 2009 at 12:46 PM, <[email protected]> wrote: > > Hello Newsgroup, > > I want to join several tables, but I won't work. I have made some > strange serendipities between C# and VB. Maybe someone could explain > what I'm doing wrong. I'm working with the Northwind project > dblinq.mysql.example from SVN. > > If you copy this code into the project you will find that the first > query (Type1) fails and the second (Type2) succeeded. I think it has > something to do with the structure of the table connection. > ############## > // Type1: Emplyees <- Orders -> Customers > Console.Clear(); > var q0 = from o in db.Orders > join c in db.Customers on o.CustomerID equals c.CustomerID > join e in db.Employees on o.EmployeeID equals e.EmployeeID > where o.Freight > 100 > select new { > o.ShipName, > c.CompanyName, > e.LastName }; > foreach (var v in q0) > ObjectDumper.Write(v); > > // Type2: Orders -> Customers -> Emplyees > Console.Clear(); > var q00 = from o in db.Orders > join c in db.Customers on o.CustomerID equals c.CustomerID > join e in db.Employees on c.Country equals e.Country > select new > { > o.ShipName, > c.CompanyName, > e.LastName > }; > foreach (var v in q00) > ObjectDumper.Write(v); > ############### > > If I do transfer the example to VB, all of my queries from type1 > succeeded and queries from type2 failed. Or a secondary explanation > could be that I don't fully understand the linq system. Can someone > tell me what I'm doing wrong? > > > Thanks in advance > > Mike > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DbLinq" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dblinq?hl=en -~----------~----~----~----~------~----~------~--~---
