471,594 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

loading dataset with a XML

Hello, i have a string with a XML inside, but when a try lo load a dataset
with the next code.

Dim all As String = Webservice.getName(TextName.Text, TextNo2.Text).ToString
'this webmethod return a string wit a XML inside
Dim xmlreader As New System.IO.StringReader(all)
Dim datas As New DataSet
datos.ReadXml(xmlarchivo)

I have the next error
the same table can`t be the table secondary in two relations nested

For some XML i Dont`t have any problem, i can load the xml to a datased, but
for this webmethod don't.

maybe my method is not good? there is other way more eficient?

Thanks
Nov 12 '05 #1
3 1316
On Mon, 14 Mar 2005 15:20:55 -0400, Mauricio Correa L. wrote:
the same table can`t be the table secondary in two relations nested


This is complaining about xml that looks like this:

<FRUIT>
<APPLE>
<WORM />
</APPLE>
<PEAR>
<WORM />
</PEAR>
</FRUIT>

The dataset builder can't create a WORM table, because it found WORM as a
subelement of two different elements.

There's no way around this with datasets, unless you want to transform your
XML to rename one or more of the tags before loading into a dataset.
Nov 12 '05 #2
The XML look like this

<?xml version="1.0" encoding="ISO-8859-1" ?>
<principal>
<basics type="S" >
<email type="F" >oo*@prub.com</email>
</basics >
<advance type="S" >
<email type="F" >xx*@prub.com</email>
</advance >
</principal>

Error "The same table (email) cannot be the child table in two nested
relations"
"Ross Presser" <rp******@imtek.com> escribió en el mensaje
news:za***************@rpresser.invalid...
On Mon, 14 Mar 2005 15:20:55 -0400, Mauricio Correa L. wrote:
the same table can`t be the table secondary in two relations nested
This is complaining about xml that looks like this:

<FRUIT>
<APPLE>
<WORM />
</APPLE>
<PEAR>
<WORM />
</PEAR>
</FRUIT>

The dataset builder can't create a WORM table, because it found WORM as a
subelement of two different elements.

There's no way around this with datasets, unless you want to transform

your XML to rename one or more of the tags before loading into a dataset.

Nov 12 '05 #3
On Mon, 14 Mar 2005 17:05:29 -0400, Mauricio Correa L. wrote:
The XML look like this

<?xml version="1.0" encoding="ISO-8859-1" ?>
<principal>
<basics type="S" >
<email type="F" >oo*@prub.com</email>
</basics >
<advance type="S" >
<email type="F" >xx*@prub.com</email>
</advance >
</principal>

Error "The same table (email) cannot be the child table in two nested
relations"


Yes, your XML fits my description perfectly.

I will repeat what I said previously: There's no way around this with
datasets, unless you want to transform your XML to rename one or more of
the tags before loading into a dataset.
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Patrick J. Schouten | last post: by
reply views Thread by Patrick Kearney | last post: by
1 post views Thread by kids_pro | last post: by
3 posts views Thread by P K | last post: by
reply views Thread by leo001 | 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.