Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Visual Studio Toolbox: Using LINQ to XML to Query Data on the Web

Download

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.

Tag:

Follow the Discussion

  • Another nice episode. Good work! Thanks Robert.
  • MaurizioMaurizio

    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. Wink

  • blueblue

    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 ?

  • Waiting for the next episode you announced (using Linq to XML to write XML instead of querying).
    Great job!

    +1

  • DanDan

    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?

  • peterpeter

    this man looks like justin huffman...

  • @peter: I hope that is a complement! Smiley

  • MichaelMichael

    Great examples
    I wish I had this months ago.

  • Just watched this on the bus ride into work.  Excellent!

  • BertBert

    Great show. I would love to see more feature deep dive episodes. Thanks for putting this together.

  • NicoNico

    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

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.