Home All Groups Group Topic Archive Search About

Reading an XML file into a Dataset - problem

Author
14 Apr 2005 8:26 PM
Paul Bromley
I have an application that needs to utilise an XML file produced by an
external application. However I am having problems getting this into a
Dataset using
dsOrganisation.ReadXml("c:\testmodify.xml"). I am getting an error that
states:- The same table (Address) cannot be the child table in tow nested
relations.

Address seems to be an element in a number of the tables conatined in the
xml file. What can I do? I have no control over the xml file that is being
created. Are there any simple examples of using an XML file with several
tables in it in VB.Net. I tend to get rather 'lost' when the XML conatins
anything except a single table.

Many thanks

Paul Bromley

Author
14 Apr 2005 9:30 PM
Paul Bromley
Having 'Googled' a little on this one, I see that it is a known bug in
VB.NET?? I have decided to do a Regex on the exported XML file, extract the
table that I am interested in and then load this into the dataset. Maybe not
elegant, but it will work for me.

Paul Bromley



Show quoteHide quote
"Paul Bromley" <flyfis***@dsl.pipex.com> wrote in message
news:%23ruKVhTQFHA.2348@tk2msftngp13.phx.gbl...
> I have an application that needs to utilise an XML file produced by an
> external application. However I am having problems getting this into a
> Dataset using
> dsOrganisation.ReadXml("c:\testmodify.xml"). I am getting an error that
> states:- The same table (Address) cannot be the child table in tow nested
> relations.
>
> Address seems to be an element in a number of the tables conatined in the
> xml file. What can I do? I have no control over the xml file that is being
> created. Are there any simple examples of using an XML file with several
> tables in it in VB.Net. I tend to get rather 'lost' when the XML conatins
> anything except a single table.
>
> Many thanks
>
> Paul Bromley
>
>
Author
15 Apr 2005 7:38 AM
Cor Ligthert
Paul,

> Having 'Googled' a little on this one, I see that it is a known bug in
> VB.NET??

Is this a by Microsoft describted bug or somebody who could not fix it and
told it?

For me it looks more that you are using a not as dataset formed XML
document.

Cor
Author
15 Apr 2005 10:14 AM
Doug Taylor
On Thu, 14 Apr 2005 22:30:36 +0100, "Paul Bromley"
<flyfis***@dsl.pipex.com> wrote:

>Having 'Googled' a little on this one, I see that it is a known bug in
>VB.NET?? I have decided to do a Regex on the exported XML file, extract the
>table that I am interested in and then load this into the dataset. Maybe not
>elegant, but it will work for me.
>
>Paul Bromley
>
>
Paul,

What I would do under these circumstances, is to open the XML file in
the IDE, this will check the validity of the XML and also give you the
opportunity of creating a schema for the XML.  When you have a schema,
you can read the XML in, but using the schema, this may well resolve
the issues as the reader can refer to the schema to understand the
data it is reading.

Doug Taylor
Show quoteHide quote
>>
>