SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru Raskolnikov's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hmmm... xmlDocument.Load issue

    SOmetimes i wander why i do this. You can have everything working just like you want, then all of the sudden, something that previously worked, now fails.

    Does anyone know why:

    Code:
    XmlDocument pgaNews = new XmlDocument();
    pgaNews.Load("http://www.pgatour.com/partners/feeds/rss/home_news");
    the second line of this two line snippet is throwing an "Object reference not set to an instance..." error?

    i have called the System.XML class, and i have varified that the address above contains xml data.

    This worked fine yesterday. didn't touch....move....alter in any form or fashion and now today for some reason i get this error.

    when i comment out the second line, the application runs (obviously without this part of the page, but it runs nonetheless) without exception.

    very frustrating.
    Ras

  2. #2
    SitePoint Guru Raskolnikov's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    606
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And today it works.....

    the internet is a wierd wierd world.

    Ras

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    That would be the ole 'net.

    I would definitely wrap the loading call in a try-catch of some sort; you are dealing with an external resource which can easy become unavailable without warning, and you had best be able to deal with it gracefully.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •