2010/6/21 Ricardo Aráoz <ricar...@gmail.com>: > On 19/06/10 18:51, Publius Maximus wrote: >> This is the magic behind sending a LINQ expression from a client to a >> SQL server, and the code actually being executed on the server side. I >> don't mean like a typical SQL query, where it sends text that needs to >> be parsed, in this case, it's the fully "ready to execute" >> representation that gets immediately executed. >> >> > > You mean the difference is the sql query gets parsed in the client? Or > the coder has to parse it? What's the big advantage of that? Never had > problems with an sql query being parsed in the server. > And what is a "ready to execute representation"? Do you mean the server > does not get to decide the strategy of the query based on resources and > such? ------------------
Here are a pair of queries that run in linq: var lambda = people.Join(pets, // outer sequence person => person, // inner sequence key pet => pet.Owner, // outer sequence key (person, pet) => new { OwnerName = person.Name, Pet = pet.Name }); // using query expression var query = from person in people join pet in pets on person equals pet.Owner select new { OwnerName = person.Name, Pet = pet.Name }; Currently both are data objects in ram but both can be switched to hitting a db by stating the Entity(schema object for the actual disk data) before the objectName. That Entity below is ET. var query = from person in ET.people join pet in ET.pets on person equals pet.Owner select new { OwnerName = person.Name, Pet = pet.Name }; Linq syntax follows more to the actual engine's working of a query statement. Process the Where clause, Joins, Where, Order by, Having and then the "output" or field list Where you write the Output first and then package all the other parts afterwords. -- Stephen Russell Sr. Production Systems Programmer CIMSgts 901.246-0159 cell _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/aanlktikj64tbioaxa5hqqkeejbmjcy7lqhr_rjuhm...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.