Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparism on two SQLs
Message
De
09/04/2012 11:56:00
 
 
À
09/04/2012 11:42:47
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01540656
Message ID:
01540675
Vues:
37
>>There must be a difference between VB's implementation of LINQ and C#'s implementation, because in C# I can't even write the first query without getting a compiler syntax error ("A query body must end with a select clause or a group clause").
>
>However, if I write the query using a lambda expression, I don't get the syntax error and it works:
>
>Syntax error:
>
>var query1 = (from person in dsPers.Personnel
>              where person.firstname == "Fred").FirstOrDefault();
>
>No syntax error and it works:
>
>var query3 = dsPers.Personnel.Where(person=>person.firstname == "Fred").FirstOrDefault();
>
>
>Strange ...

Indeed, thanks for the elaboration on the topic.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform