|
The LINQ Project:
Visual Basic |
|
|
|
|
|
|
|
|
|
|
|
|
|
Microsoft .NET LINQ Preview (May 2006) is now installed on your machine.Welcome to the Microsoft .NET LINQ Preview (May 2006). This is an enhanced version of the LINQ Preview unveiled at PDC 2005. It contains documentation and samples to let you see Language-Integrated Query in action, as well as preliminary IDE support so you can write your own queries. This release installs a Visual Basic 9.0 compiler, documentation, and sample projects with which you can explore the new feature-set. While the prototype compiler contains feature additions to the Visual Basic language, there remain many features related to LINQ that are not yet implemented. This release builds on January’s CTP, which focused on DLinq in VB and improved editor support for LINQ. This release features improved DLinq support (inheritance, stored procedures, and the new DLinq Designer), support for “Group By” in queries, and LINQ over DataSet. The features contained in these bits and outlined in the content are only preliminary designs; your feedback is requested! Check out the LINQ Home Page on MSDN for more samples, videos with the designers of LINQ and the VB language, and forums where you can share and discuss your experiences with the LINQ Project. What’s new?Enhanced DLinq Support: This CTP adds support for Inheritance, Stored Procedures, User-Defined Functions, and Optimistic Concurrency Conflict Resolution (OCCR). The new DLinq Designer provides a visual design surface for creating DLinq entity classes from database tables. LINQ over DataSet: The full power of LINQ can now be applied to the DataSet, allowing you to use the Standard Query Operators and some DataSet-specific extensions to query against DataRows.“Group By” Query Comprehensions: The compiler now supports “Group By” as a valid clause in LINQ Queries. Outlining support for XML Literals in the Editor: In this release, we added outlining support for XML literals. You can now expand or collapse any Xml element literal that spans across more than one line. Value extension property for XML axis properties: We added a Value extension property to the collections that are returned from the XML axis properties (i.e. IEnumerable(Of XElement) and IEnumerable(Of XAttribute)). This extension property does two things, it first picks up the first object in that IEnumerable, and if this object exists, it calls the "Value" property on this object (either XElement or XAttribute). The following code show the use of this Value extension property: Dim contact = <Contact City="Seattle"> <Name>Joe</Name> </Contact> Console.WriteLine(contact.@City.Value) contact.@City.Value = "Portland" Console.WriteLine(contact.@City.Value) Console.WriteLine(contact.<Name>.Value) contact.<Name>.Value = "Sam" Console.WriteLine(contact.<Name>.Value)
Results: Seattle Portland Joe Sam Global Xml namespace support: XML namespaces that are declared using the Imports statement can now be used in the XML literals. The following is an example: Imports ns = "http://www.w3.org/1999"
Module Module1 Sub Main() Dim book = _ <ns:Book> <ns:Title>Learning Programming Using VB</ns:Title> </ns:Book> Console.WriteLine(book.<ns:Title>.Value) End Sub End ModuleWhat’s changed?Select/From syntax: The previous tech preview supported using Select before From. In an effort to provide better IntelliSense™, we’re switching to the From/Select format for this CTP. Joins don’t require “It”: You don’t need to use the iterator variable “it” anymore when performing a join operation, though it’s still required for grouping operations. Xml axis properties syntax: The late bound Xml feature has a new name and a new distinct syntax where we wrap the element name with angle brackets. This new syntax makes the Xml axis properties visually distinct and solves problems that the previous CTP syntax had. See more information in this blog Prerequisites:The following are the requirements for the LINQ: Visual Basic Tech Preview:
Documents:
Samples:
Visual Basic IDE Support:The installer sets up 3 LINQ project templates (LINQ Windows Application, LINQ Console Application, and LINQ Class Library) that you can use to create your own Visual Basic 9.0 projects using LINQ. IDE Support for Visual Basic 9.0 atop Visual Studio 2005:Project LINQ relies on several changes to the Visual Basic language. Visual Basic 9.0 contains new keywords and syntax and is not considered valid by the Visual Studio 2005 IDE. The IDE support included in this build is very much in alpha phase; some keywords may not be colorized correctly, IntelliSense™ may not work in all spots you expect it to, and the syntax error strings may not be descriptive. When in doubt, refer to the samples and documents shipped with this tech preview. C# Support:If you also have C# installed on your machine, the files for the C# Preview are installed. The readme for C# can be found here. The preview files for C# are not installed if you do not have C# installed as a part of Microsoft Visual Studio 2005 or Microsoft C# Express 2005. Forum:Join fellow LINQ Preview users for discussions at the LINQ forumBloggers:Several Microsoft bloggers will be talking about the LINQ Project, and specifically VB support for LINQ. The RSS feeds for their blogs will be fed to the MSDN VB Futures site. Check it out regularly for the latest tips and tricks! http://msdn.microsoft.com/vbasic/future Also check out the LINQ Home Page on MSDN for more samples, videos with the designers of LINQ and the VB language, and forums where you can share and discuss your experiences with the LINQ Project. Known Issues and Troubleshooting:A list of known issues and workarounds where available is on the LINQ home page.
|
||||
|
||||
|
|
|
|
|
Copyright © 2006 Microsoft Corporation. All rights
reserved.