Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declaration of link objects
Message
De
07/11/2011 11:48:15
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
07/11/2011 11:45:48
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:
01528239
Message ID:
01528268
Vues:
39
J'aime (1)
>>you can create loJobs anywhere you want. The query isn't executed until you actually use it.
>
>It is interesting however that we can have access to the Count property even if the query hasn't been executed, thus just before the For Each loop. Because, I have this code:
>
>
>Dim loJobs = (From...)
>
>' If we have some records
>If loJobs.Count > 0 Then
>   ' Do something
>End If
>
>' For each record
>For Each loJob In loJobs
>    ' Do something
>Next
>
The Count property will execute the query.
Very fitting: http://xkcd.com/386/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform