|
-
May 27th, 2004, 10:54 PM
#1
Thread Starter
Hyperactive Member
XML/Dataset Help
Hello Peeps..
I have a bit of a problem, maybe someone can help me out.. I have a class that has an array list in it.. and the objects I stick in the arraylist also have array lists in them as well. When a user logs into my system and creates a account.. I have a bit of a tree setup as so..
AccountData
\
Character Data (Array List that can hold 8 characters per acct)
\
Character Inventory (Inventory for the selected character)
Now what I am doing is serializing the whole AccountData class to XML format. That works fine.. But from there I go to read the XML file into a Dataset so I can display the data in a datagrid and I get the following error..
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: The table (CharInv) cannot be the child table to itself in nested relations.
Now if I comment out the Character inventory, it will take one level of nesting from the AccountData class with a ArrayList in it filled with Characters, but each character has to have an array list in it as well..
As I said, it is written to xml fine from the serializer..
Code:
<?xml version="1.0" ?>
- <clsAcctData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AcctName>Wuzzbent</AcctName>
<AcctPass>My$ecret</AcctPass>
<AcctMail>[email protected]</AcctMail>
- <CharData>
- <anyType xsi:type="clsCharData">
<CharName>John Boy</CharName>
<CharGender>Male</CharGender>
- <CharInv>
- <anyType xsi:type="clsGameObj">
<oName>A Game Object</oName>
<oDesc>A new bouncing baby game object.</oDesc>
</anyType>
</CharInv>
</anyType>
</CharData>
</clsAcctData>
Now why wont a Dataset be able to read this, is there something special I have to do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|