Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declaration of link objects
Message
From
07/11/2011 13:28:13
 
 
To
07/11/2011 10:45:06
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:
01528288
Views:
41
>I like to have all the declarations at the top of the method. I have a code where the declaration is part of the LINK select line such as:
>
>
>Dim loJobs = (From...
>
>
>How can I declare loJobs as in its own DIM line and have the LINK select line in another one?

If the query returns an anonymous type then you can't. If the query yields a known type then something like this will work:
Dim list As New List(Of String)() From { _
	"One", _
	"Two", _
	"Three" _
}
Dim s As IEnumerable(Of String)
s = From x In list select x
(Disclaimer: used a C# -> VB converter and assuming the translation is correct)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform