Visual Studio Toolbox: Using LINQ to XML to Query Data on the Web
- Posted: Sep 28, 2011 at 12:41PM
- 12 comments
Loading user information from Channel 9
Something went wrong getting user information from Channel 9
Loading user information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
These days, Web sites are providing access to a large amount of data, everything from RSS feeds to pictures to movie titles and more. Often, all you need to do in an application is send an HTTP request to a Web site. The Web site sends the data back via XML, and the easiest way to work with that data is to use LINQ queries. In this episode, Robert shows you how to use LINQ to XML to make sense of the XML data a Web site sends you. He gives examples of working with an RSS feed, retrieving images from Flickr, querying for wineries and wines using Wine.com, and returning movies from NetFlix. You'll see basic queries, see how to retrieve data from elements and attributes, and see how to work with namespaces.
Check out Robert's blog for all the code he used in this episode.