[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1613
  • Last Modified:

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.  
0
rodmjay
Asked:
rodmjay
1 Solution
 
gregoryyoungCommented:
easy way to change the names would be to run it through a quick xslt transformation to change the names although this does not sounds optimal.



0
 
rodmjayAuthor Commented:
I redesigned the app to use txt values instead of XML.  Thanks anyway
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now