Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declaration of link objects
Message
From
07/11/2011 11:48:15
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
07/11/2011 11:45:48
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01528239
Message ID:
01528268
Views:
41
Likes (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/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform