Thursday, September 25, 2008

Using RSS feeds in asp .net and C#

·


using System.XML;


Gets the xml from the Url using XmlTextReader

XmlTextReader reader = new XmlTextReader("http://msdn.microsoft.com/rss.xml");


creates a new instance of DataSet

DataSet ds = new DataSet();


Reads the xml into the dataset

ds.ReadXml(reader);


Assigns the data table to the datagrid

grid.DataSource = ds.Tables[0];
myDataGrid.DataBind();

0 comments: