Reading xml attibute using dataset

G

Guest

i am trying to read the following xml in asp.net using C#.I want a mechanism to read the value of id (xxx) and also the value itself (sam
<?xml version="1.0" standalone="yes"?><root><buglist><Bugid>1</Bugid><version>5.0</version><description id ="xxx">sam</description><reported_by>Dallas</reported_by></buglist></root

DataSet d = new DataSet()
FileStream myFs = new FileStream("E:\\webapps\\dbbuglist\\test1.xml",FileMode.Open,FileAccess.Read)
d.ReadXml(myFs)

foreach(DataRow myRow in d.Tables["buglist"].Rows


Label1.Text= Int32.Parse((myRow["Bugid"].ToString()));
Label2.Text= Int32.Parse((myRow["version"].ToString()));

Label3.Text= read description ??
Label4.Text= read id ???

Label5.Text= Int32.Parse((myRow["reported_by"].ToString()));



I get an error when i read the descrption node. can you help me get this up on running.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top