Error when I use XPath.XPathDocument() function

510 Views Asked by At

I'm using this code in my ASP.NET/VB.NET project:

Dim sourceFile as String = "http://xml.weather.yahoo.com/forecastrss?p=94704"
Dim xPath As New XPath.XPathDocument(sourceFile)

and the second line gives the error: "Unable to connect to the remote server"

When I browse the url (sourceFile) in web browser, it opens the RSS feeds page finely. How can I remove this error?

1

There are 1 best solutions below

0
On

Here is nothing about XPath.XPathDocument if your application is unable to connect to the remote server.

Check the connection using another method, e.g. WebClient.