Home > Microsoft .Net Development News > LINQ and XML programming in Visual Basic 9
Microsoft .Net Development News:
EMAIL THIS

LINQ and XML programming in Visual Basic 9

By Brian Eastwood, Site Editor
13 Jun 2007 | SearchVB.com

.NET News Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

As Visual Basic 9 nears its year-end release, Microsoft is making a concerted effort to introduce developers to its new features -- notably the Language Integrated Query, or LINQ, but also improved XML support and more intuitive IntelliSense.

At Tech Ed 2007, Amanda Silver, program manager for Visual Basic, demonstrated each of these features to Visual Basic developers. Taken together, she said, they make the release of Visual Basic 9 bigger than VB's move to the .NET Framework.
More on Visual Basic and LINQ
Let's think about LINQ

Visual Basic's future: LINQ, Orcas and, yes, VB 6

How Visual Basic 9, Windows Vista appeal to the Visual Basic 6 developer

LINQ has garnered the most attention among the new features in VB 9.0 and C# 3.0, largely because it allows developers to query anything that is IEnumerable -- objects, datasets, XML and so on.

"We took the query and the transform operations and brought them into VB, and we did it in such a way that the code you write is abstracted away from the data source you are querying over," Silver said.

LINQ offers quite a bit of support for query expressions such as aggregation, partitioning, grouping and ordering. This means that, while the compiler is busy, developers should not be, Silver said: "We do all the heavy lifting. You just need to write the query you need."

These queries, moreover, can take on complex forms. If operations are built up line by line, the compiler will call them sequentially. If a query is issued on top of the results of another query, it is not executed until the results are enumerated, and only one query is issued to the database.

Structurally, LINQ queries are modeled after TSQL queries, with one important difference -- in LINQ, From comes before Select. Ever since LINQ made its debut at PDC 2005, Silver said, the message Microsoft has heard is that "IntelliSense is way more important than staying close to SQL syntax."

Given that IntelliSense now comprises much more than just keywords, such a notion is not surprising.
More on Visual Basic and XML
Using XML in Visual Basic 2005: Chapter 12 of Professional VB 2005

Mini-Guide: Data binding and XML

For example, thanks to Extension Methods, which are defined through attributes and applied to a module, a shared method can be applied as an instance method. In addition, when an object is created and properties are assigned to it, the compiler will infer the object's type, Silver said. Along those same lines, properties need not be specified, either, as the compiler will infer those based on the expression, she added.

These instances of type inference are, by default, turned on for new Visual Studio 2008 projects but turned off for migrated projects.

Developers should also notice that IntelliSense comes in handy when working with XML as well. Bring in an XML document, or copy and paste XML code into Visual Studio, and the IDE will infer its schema, saving it as an .xsd file. Once this file is passed into a VB project, full XML IntelliSense is available "anywhere that expression is valid in Visual Basic," Silver said.

This "functional construction," in which passing a set of arguments to a constructor subsequently passes a query result, is a significant improvement over the current methodology for XML programming, Silver added. This involves describing to the API what a developer is trying to do with the XML, which has to be done in a document.

Tags: .NET Framework 3.5 and Visual Studio 2008 developmentVisual Studio 2008 and Language Integrated Query (LINQ).NET Framework development with XML and XAMLVIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers

Visual Studio 2008 and Language Integrated Query (LINQ)
LINQ in Visual Studio 2008 addresses object data modeling
LINQ Learning Guide: Third-party LINQ Implementations
LINQ Learning Guide: LINQ to Entities
LINQ Learning Guide: LINQ to SQL
LINQ Learning Guide: LINQ to DataSet
LINQ Learning Guide: LINQ to Objects
LINQ Learning Guide: LINQ Providers
LINQ Learning Guide
LINQ Learning Guide: LINQ and Visual Studio 2008's new language features
LINQ Learning Guide: LINQ and Web applications

.NET Framework development with XML and XAML
How to write an out-of-browser Silverlight 3 application in 3 steps
Ajax Learning Guide
Ajax Learning Guide
Open XML SDK ready for the road
XAML as an everywhere presentation format
Silverlight Spy scans XAML objects, eases JavaScript debugging
Java presentation tool outputs XAML files
Microsoft, Cisco et al. to partner on modeling language
Microsoft's XAML recasts UI development
XAML Learning Guide: Forums and Community

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Cosmos  (SearchWinDevelopment.com)
IronRuby  (SearchWinDevelopment.com)
Visual Studio Express (VSE)  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Development Solutions - Silverlight, WinForms, ASP.NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts