Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declaration of link objects
Message
From
07/11/2011 11:45:48
 
 
To
07/11/2011 11:09:49
John Baird
Coatesville, Pennsylvania, United States
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:
01528266
Views:
36
>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
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform