471,326 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

xml and data sets

Hi,

I am trying to put some XXL comde in a database column, and I am using a
dataset to edit it...

let's imagine this scenario

<?xml version = "1.0"?>
<root>
<class>
<student studentID="13429" name = "John"/>
<student studentID="13430" name = "Mary"/>
</class>
</root>

I can manipulate at easy everything except creating students inside the
class...

How can I do it using a DataSet?
Dec 12 '05 #1
2 1055
Create a DataSet with a single DataTable in it. Add the columns necessary to
the DataTable, and set the type of each column. Then read each "student"
element in the XML file, getting the attribute values from the element, and
reading them into a new row in the DataTable for each element, putting each
attribute value into the appropriate column.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:10**********************************@microsof t.com...
Hi,

I am trying to put some XXL comde in a database column, and I am using a
dataset to edit it...

let's imagine this scenario

<?xml version = "1.0"?>
<root>
<class>
<student studentID="13429" name = "John"/>
<student studentID="13430" name = "Mary"/>
</class>
</root>

I can manipulate at easy everything except creating students inside the
class...

How can I do it using a DataSet?

Dec 12 '05 #2
On Mon, 12 Dec 2005 03:56:01 -0800, "Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote:
Hi,

I am trying to put some XXL comde in a database column, and I am using a
dataset to edit it...

let's imagine this scenario

<?xml version = "1.0"?>
<root>
<class>
<student studentID="13429" name = "John"/>
<student studentID="13430" name = "Mary"/>
</class>
</root>

I can manipulate at easy everything except creating students inside the
class...

How can I do it using a DataSet?


Have you tried:

<?xml version = "1.0"?>
<root>
<class>
<student>
<studentID>13429</studentID>
<studentName>John</studentName>
</student>
<student>
<studentID>13430</studentID>
<studentName>Mary</studentName>
</student>
</class>
</root>
rossum
The ultimate truth is that there is no ultimate truth
Dec 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ben moretti | last post: by
6 posts views Thread by Saikrishna | last post: by
4 posts views Thread by Oyvind | last post: by
6 posts views Thread by Ben Finney | last post: by
11 posts views Thread by mwt | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.