Click here to Skip to main content
11,702,396 members (72,666 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Reading XML documents using LINQ

, 18 Jan 2011 CPOL 3.4K 1
Another option would be to use the Elements extension method[^]:var root = XElement.Load("Books.xml"); var books = from node in root.Elements("Book").Elements("Subject") select node.Value.Trim(); foreach (string subject in books){ listBox1.Items.Add(subject);}
No downloads associated with this content

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Richard Deeming
Software Developer Nevalee Business Solutions
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150819.1 | Last Updated 18 Jan 2011
Article Copyright 2011 by Richard Deeming
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid