VB9 has come a long way in the new March CTP of Orcas! Paul Vick has a quick list of what is now in there. And there are a lot of good details in the msdn documentaiton that comes along with the CTP.
A few things I noticed quickly when bringing my LINQ for SQL demos over to the new bits.
Here's a before (as in earlier CTP) and an after (March CTP) example of a simple query that does all of these things.
OLDFrom s In db.Suppliers _ Select New {Company := CompanyName, Country, Products}
NEWFrom s In db.Suppliers _ Select New With {.Company = s.CompanyName, s.Country, s.Products}
Here's what it looks like with a nested query From s In db.Suppliers _ Select New With {.Company = s.CompanyName, s.Country, _ .Products = (From p In s.Products _ Select New With {p.ProductName})}
OLD with Order ByFrom s In db.Suppliers _ Select New {s.CompanyName, s.Country, s.Products} _ Order By CompanyName
NEW with Order By Dim mylist = From s In db.Suppliers _ Select s2 = New With {s.CompanyName, s.Country, s.Products} _ Order By s2.CompanyName
I've seen samples where "s" has been used for both the reference to the items in the db.suppliers collection AND to the name of the new anonymous type. That scares me, so I used a new variable (s2).
There is also a whole new set of query samples in the MSDN documentation.
Remember Me
See my speaking schedule for more events
User Group Leader
Hosted by:
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Julie Lerman
E-mail