Link to home
Start Free TrialLog in
Avatar of rodmjay
rodmjayFlag for United States of America

asked on

The same table cannot be the child table in two nested relations.

I am trying to read an XML file using the Dataset.readxml method.  Here is the XML File i am trying to read (simplified)

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE ShopSiteOrders PUBLIC "-//shopsite.com//ShopSiteOrder DTD//EN" "http://www.shopsite.com/XML/1.2/shopsiteorders.dtd">
<ShopSiteOrders>
      <Order>
            <Billing>
                  <NameParts>
                        <Title />
                        <FirstName>JO-ANNE</FirstName>
                        <MiddleName />
                        <LastName>GRANDE</LastName>
                        <Suffix />
                  </NameParts>
            </Billing>
            <Shipping>
                  <FullName>JO-ANNE GRANDE</FullName>
                  <NameParts>
                        <Title />
                        <FirstName>JO-ANNE</FirstName>
                        <MiddleName />
                        <LastName>GRANDE</LastName>
                        <Suffix />
                  </NameParts>
            </Shipping>
      </Order>
</ShopSiteOrders>

I keep getting this error when i try to run the command .readxml:

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: The same table (NameParts) cannot be the child table in two nested relations.


One thing i noticed is that if i change the name of one of the NameParts tables, it works just fine, so if you know how to change the name of one of these table names on the fly that may be an ok workaround although not preferred.  
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rodmjay

ASKER

I redesigned the app to use txt values instead of XML.  Thanks anyway