Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access XML in Dataset

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I am using VS 2005.
My dataset read this XML
<Rows xmlns:xsi=" <Row id="12345678890" peopleid="12345">
<Field id="F1" type="Varchar">Val1</Field>
<Field id="F2" type="Varchar">Val2</Field>
<Field id="F3" type="Varchar">Val3</Field>
</Row>
</Rows>

I bound the dataset to the datagridview, but it only shows the id and peopleid from the row.
How could I through code access the F1, F2, F3 values?
 
I figured out that I could do this:
ds.Tables(1).Rows(0).Item(0).ToString()
ds.Tables(1).Rows(0).Item(1).ToString()
ds.Tables(1).Rows(0).Item(2).ToString()
ds.Tables(1).Rows(1).Item(0).ToString()
ds.Tables(1).Rows(1).Item(1).ToString()
ds.Tables(1).Rows(1).Item(2).ToString()
Just have to write up a looping routine to go through them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top