Navigate a DataSet/DataTable
- From: "Carl Lindmark" <RepliesInNewsGroupOnly@Thanks>
- Date: Tue, 17 May 2005 16:01:19 +0200
Hello,
I am having trouble understanding how to navigate a DataSet table... - maybe
someone can steer me in the right direction?
Say you've read an XML document into a DataSet ("myDataSet") and then filled
a DataTable by doing: myDataSet.Tables["situation"];
and the XML looks this way:
....
<situation>
<objectID>123</objectId>
<validityPeriod>
<start>2004-10-16T06:00:00+02:00</start>
<end>2004-10-18T15:00:00+02:00</end>
</validityPeriod>
....
</situation>
....
Now, the DataTable is filled nicely and I can access the "objectId" value
easily, but I just don't understand how I can go from "situation" to
"validityPeriod" and then on to "start" and "end".
I THINK I managed to get to the "start" and "end" values directly, by using
"GetChildRows" somehow - but the way I did that, I couldn't make sure that
the "start" and "end" I found were actually children of "validityPeriod",
which I have to be sure of.
Could anyone help me navigate this DataTable?
Thanks in advance!
Sincerely,
Carl Lindmark
.
- Follow-Ups:
- Re: Navigate a DataSet/DataTable
- From: Dmytro Lapshyn [MVP]
- Re: Navigate a DataSet/DataTable
- Prev by Date: Re: c# delete directory containing read only files
- Next by Date: Re: .Net (C#) Service Fails To Start
- Previous by thread: Format16bppGrayScale not supported
- Next by thread: Re: Navigate a DataSet/DataTable
- Index(es):
Relevant Pages
|