Click here to Skip to main content
Click here to Skip to main content

Reading XML documents using LINQ

By , 14 Jan 2011

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

18 Jan 2011  
Richard Deeming
 
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);}
15 Jan 2011  
Anupama Roy 2 alternatives  
 
Reading XML documents using LINQ

License

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

About the Author

Andrew Rissing
Software Developer (Senior)
United States United States
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.
 
So..If you're not moving forward, you're moving backwards.

| | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 14 Jan 2011
Article Copyright 2011 by Andrew Rissing
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid