Using xml source in datagrid -- possible with non-structured data?

K

KatB

Hi, is it possible to use a datagrid (read only) that has an xml source
that is NOT database-type structured? For example:

<assembly>
<work_order no="12345">
<station name="one">
<boards>
<board sn="111" start="10/23/03 11:30:12am"/>
<board sn="112" start="10/23/03 11:35:14am"/>
<board sn="113" start="10/23/03 11:40:16am"/>
</boards>
</station>
<station name="two">
<boards>
<board sn="111" start="10/23/03 12:30:12am"/>
<board sn="112" start="10/23/03 12:35:10am"/>
<board sn="113" start="10/23/03 12:40:15am"/>
</boards>
</station>
<station name="three">
<boards>
<board sn="111" start="10/24/03 08:10:10am"/>
<board sn="112" start="10/24/03 08:15:05am"/>
<board sn="113" start="10/24/03 08:20:30am"/>
</boards>
</station>
</work_order>
</assembly>

The datagrid report would look like:

Station SN Start
------------------------------------------
One 111 10/23/03 12:30:12am
------------------------------------------
One 112 10/23/03 11:35:14am
------------------------------------------
One 113 10/23/03 11:40:16am
------------------------------------------
Two 111 10/23/03 12:30:12am
------------------------------------------
Two 112 10/23/03 12:35:10am
------------------------------------------
etc.

If someone could point me to examples or explain a bit how to do this?

Thanks, Kat
 
C

Craig Deelsnyder

KatB said:
Hi, is it possible to use a datagrid (read only) that has an xml source
that is NOT database-type structured? For example:

<assembly>
<work_order no="12345">
<station name="one">
<boards>
<board sn="111" start="10/23/03 11:30:12am"/>
<board sn="112" start="10/23/03 11:35:14am"/>
<board sn="113" start="10/23/03 11:40:16am"/>
</boards>
</station>
<station name="two">
<boards>
<board sn="111" start="10/23/03 12:30:12am"/>
<board sn="112" start="10/23/03 12:35:10am"/>
<board sn="113" start="10/23/03 12:40:15am"/>
</boards>
</station>
<station name="three">
<boards>
<board sn="111" start="10/24/03 08:10:10am"/>
<board sn="112" start="10/24/03 08:15:05am"/>
<board sn="113" start="10/24/03 08:20:30am"/>
</boards>
</station>
</work_order>
</assembly>

The datagrid report would look like:

Station SN Start
------------------------------------------
One 111 10/23/03 12:30:12am
------------------------------------------
One 112 10/23/03 11:35:14am
------------------------------------------
One 113 10/23/03 11:40:16am
------------------------------------------
Two 111 10/23/03 12:30:12am
------------------------------------------
Two 112 10/23/03 12:35:10am
------------------------------------------
etc.

If someone could point me to examples or explain a bit how to do this?

Thanks, Kat

Yes, if you read the XML into a dataset, it will infer a schema (table
structure) for you....check out this article about consuming an RSS feed
with a datagrid ASP.NET page...follow its principles of finding the
tables in the dataset:

http://aspnet.4guysfromrolla.com/articles/031903-1.aspx
 
G

Guest

dim ds as new dataset
ds.readxml("c:\xmlsrc.xml")
it will work
use this ds as datasource for ur grid
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top