Visual Studio Toolbox: Using LINQ to XML to Query Data on the Web
- Posted: Sep 28, 2011 at 12:41 PM
- 49,757 Views
- 12 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- Mid Quality WMV (Lo-band, Mobile)
- High Quality MP4 (iPad, PC)
- MP4 (iPod, Zune HD)
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.
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Waiting for the next episode you announced (using Linq to XML to write XML instead of querying).
Great job!
Good show but lets not waste time with VB examples.
Many answered about what we want to see but you do not listen to what we say.
Lets try one more time:
We want to see C++11 with visual studio using GCC and clang.
Do you refuse to listen because the compiler we want to use is GCC which is not a microsoft product ?
Great episode Robert. As JSON is becoming more popular than XML due to it's smaller size, what about a show on LINQ to JSON? I see there are some frameworks out there that can do this. What about a show on this?
this man looks like justin huffman...
@peter: I hope that is a complement!
Great examples
I wish I had this months ago.
Just watched this on the bus ride into work. Excellent!
Great show. I would love to see more feature deep dive episodes. Thanks for putting this together.
I like this style of deep dive, but I have one remark.
Never use the query operator Count() to check for the presence of items in a sequence! You should generally use Any(), as Count() needs to read the complete sequence. (In your example prefer !posts.Any() over posts.Count() == 0; because you are materializing the sequence twice, in Count() and on iterating the sequence.)
Remove this comment
Remove this thread
close