XmlTextWriter and RSS files

  • Thread starter Thread starter jeremy hillin
  • Start date Start date
J

jeremy hillin

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();
 
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.

--------------------
 
Back
Top