Language Integrated Query (LINQ, pronounced “link“) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages.(#)

LINQ to XML is a built-in LINQ data provider that is implemented within the “System.Xml.Linq” namespace in .NET 3.5.

As Microsoft says, LINQ to XML provides a clean programming model that enables you to read, construct and write XML data. LINQ to XML can be used to perform LINQ queries over XML to retrieve from your local server or from a remote HTTP URL or web-service, or from any in-memory XML content.

They says that LINQ to XML provides much richer (and easier) querying and data shaping support than the low-level XmlReader/XmlWriter API in .NET. It also ends up being much more efficient (and uses much less memory) than the DOM API that XmlDocument provides.

Today I will give a simple example that uses LINQ to XML (VB.NET and C#) › Continue reading…