Loading xml into dataset fails

G

Guest

What would cause the xml in this example to fail when loaded into a dataset
Changing the childnode '<a>' under 'node2' to something else fixes the problem, but I really need to understand why this happens, although the two '<a>'s are under different nodes

<Body
- <node1><a>1</a><b>2</b></node1
- <node2
- <a><a1>1</a1><a2>2</a2></a></node2></Body>
 
D

drew

There is a limit to what a dataset can infer from your xml. It roughly
assumes that an outermost element is your dataset container, and your
dataset will assume this name. The next level down is assumed to contain any
datatables. Inside that level the fields for that datatable and below that,
the actual data for those fields.

In your case I'd think it sees two a columns in both datatables and tries to
establish a relationship constraint but it cannot because the lower a
contains two more complex elements and the upper a contains just a data
item.


Justus said:
What would cause the xml in this example to fail when loaded into a dataset.
Changing the childnode '<a>' under 'node2' to something else fixes the
problem, but I really need to understand why this happens, although the two
' said:
<Body>
- <node1>
<a>1</a>
- <node2>
- <a><a1>1</a1>
<a2>2</a2>
</a>
</node2>
</Body>
 

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

Top