Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds


  Asked By: Sunil    Date: Oct 18    Category: Asp.net    Views: 814

How do I parse an xmlbased message from a messag



2 Answers Found

Answer #1    Answered By: Saxon Anderson     Answered On: Oct 18

I luuuvvvvv the XMLTextreader


You can also read a XML file into a dataset:

look at the slippers.xml file portion.

Answer #2    Answered By: Geraldine Perkins     Answered On: Oct 18

Speaking of the XmlTextReader, check out my latest article:

Consuming an RSS Feed with ASP.NET

The above article shows how to consume an RSS feed (which contains
syndicated content for a Web site in XML format) and display the RSS
data in a DataGrid. When I first sat down to write this code I thought
it would be several lines long - I was very wrong. The entire code
section is like 10 lines long, and that includes CACHING the data,
reading the remote XML data, and binding it to a DataGrid!

This brevity is due in large part to the XmlTextReader. I can populate
the XmlTextReader with remote XML in one line of code:

Dim reader as XmlTextReader = New

And then dump it into a DataSet in two lines of code:

Dim ds as DataSet = New DataSet()

And then display it in a DataGrid in another two lines of code:

datagridID.DataSource = ds.Tables(2)

It's that simple! Some other worthwhile articles that deserve a look

XML, the DataSet, and a DataGrid

which essentially looks at displaying XML data in a DataGrid,

DataGrids, DataSets, and XML Strings

which looks at dumping the contents of a DataGrid out to XML. There are
also articles at http://aspnet.4guysfromrolla.com/ that show how to use
cache dependencies to cache XML data that is being displayed in a
DataGrid, that expires whenever the underlying XML data store is
altered. Neat, neat stuff.

<shameless plug>
For more information on the DataGrid, DataList, and Repeater controls,
consider picking up a copy of my latest book:

ASP.NET Data Web Controls
</shameless plug>

Didn't find what you were looking for? Find more on parsing Or get search suggestion and latest updates.