LINQ is all the rave lately. In case you have been under a rock, it stands for Language-Integrated Query. I have used it many times from LINQ to SQL (SQLServer only supported), but this was my first opportunity to use it with XML.  It was not my first choice, mostly because I was unfamiliar with it; however, it will be my first choice to work with XML in the future.  It was very easy to get the data the way I needed.  LINQ to XML (formerly XLINQ) uses the same syntax as you would see with SQL Server, it is just a different source of data.

I am just going to show a simple loop through an XML file with some child nodes.  Here is a link to the XML file that I will be using: Test.xml.

This VB code just processes the XML file and pulls the data in a parent or child loop.  It depends on a list box named "lstOutput". 



Comments are closed.