Click to See Complete Forum and Search --> : Dataset Loading


mrkensr
03-17-2010, 01:56 PM
I am trying to load data from a stored procedure into a dataset.
I am able to load the xsd using

TestDataset.ReadXmlSchema("D:\\Data\\v5.0.xsd");
TestDataset.Namespace = "http://www.w3.org/XMLSchema";

If I stop at a breakpoint right after this I can see the contents of the dataset at this point.It show the "tables" read in from the xsd.
It also shows the relationships between tables.
The problem is that when I try to load data this way:

TestDataset.Load(sqlReader1, LoadOption.PreserveChanges, new String[] {"Account","Recipient","StandingInstruction" });

I have tried 1 table at at time or all 3 , but after loading data, the tables are filled, but not the relationships. Because of this the output XML is incorrect.

The first table"Account" has a field added that is Account_Id and is incremented, but the relation fields between this table the others are not.

I am still pretty new at this and Im missing something...not sure what...any help?