Book Image

LINQ Quickly

By : N Satheesh Kumar
Book Image

LINQ Quickly

By: N Satheesh Kumar

Overview of this book

<p>This book gets you started with LINQ and shows how it will make your programming life easier by making use of new features from the .NET Framework 3.0. This book is split into seven chapters, each of which is dedicated to presenting a feature of LINQ and its usage in real-life scenarios. <br /><br />Language Integrated Query (LINQ) is a new feature in Visual Studio 2008 that extends its query capabilities, using C# and Visual Basic. Visual Studio 2008 comes with<br />LINQ provider assemblies that enable the use of LINQ with data sources such as in-memory collections, SQL relational databases, ADO.NET Datasets, XML documents, etc.<br />In Visual Studio 2008, Visual C# and Visual Basic are the languages that implement the LINQ language extensions. LINQ language extensions use the new standard query operators API, which is the query language for any collection that implements IEnumerable&lt;T&gt;.</p>
Table of Contents (14 chapters)
LINQ Quickly
Credits
About the Author
About the Reviewer
Preface
Building an ASP.NET Application
LINQ with Outlook

LINQ to XML with Other XML Technologies


When we talk about using XML, the first thing that comes to our mind is the XML DOM. We use XML programming API of W3C Document Object Model (DOM). XML programming means either traversing or manipulating data in the XML tree. These are the only things that we normally do with an XML document. In case of XML DOM, we follow the "bottom-up" approach of creating the XML document using XmlDocument object first and then building the XML elements and attributes. We do programming with elements and attributes. Coming up is an example of creating an XML document using XML DOM, which is the standard way of doing it using ADO.NET 2.0.

The following code creates an XML document Icecreams to store different varieties of ice-creams as XML elements. Each ice-cream element contains many elements to hold the properties of ice-cream. Each XML element is created separately and then added to the main Icecream element as children. After adding all the properties as elements...