Hi Jeremy,
I can not reproduce the problem.
Here is my code.
private void Page_Load(object sender, System.EventArgs e)
{
XmlTextReader reader = new
XmlTextReader("http://msdn.microsoft.com/rss.xml" );
DataSet ds = new DataSet();
ds.ReadXml( reader );
this.DataGrid1.DataSource = ds.Tables[2];
this.DataGrid1.DataBind();
}
You may try to create a new project and paste the code to the Page_Load
event handling function to see
if the problem persists.
BTW, can you read the xml file from Localhost? You may download it to the
<wwwroot> directory.
e.g.
XmlTextReader reader = new XmlTextReader("http://localhost/rss.xml" );
BTW, do you have a proxy or firewall setting?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "jeremy hillin" <je**********@orecity.com>
Sender: "jeremy hillin" <je**********@orecity.com>
Subject: XmlTextWriter and RSS files
Date: Thu, 18 Sep 2003 12:53:04 -0700
Lines: 17
Message-ID: <76****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN+Hnkw/IbenIusTdalTRf63ukMpA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109086
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general
I am trying to read the MSDN RSS.xml file and populate a
datagrid in an aspx page. I ran this same code in a
WinForm app and it works. I get this error on my aspx
page. I get the error on the ds.ReadXML( reader );
"The underlying connection was closed: Unable to connect
to the remote server"
XmlTextReader reader = new XmlTextReader
( "http://msdn.microsoft.com/rss.xml" );
DataSet ds = new DataSet();
ds.ReadXml( reader );
this.DataGrid1.DataSource = ds.Tables[2];
this.DataGrid1.DataBind();