Cannot DataSet.ReadXml a file written with DataSet.WriteXml 
Author Message
 Cannot DataSet.ReadXml a file written with DataSet.WriteXml

Hello,

I have defined a dataset using the dataset designer, using
Element for tables and Attribute for columns. All columns are String.

I do no operations that modify the schema in the application.
The DataSet is strongly typed, and the corresponding class is genereated
automatically by VS from the dataset schema (xds) file.

Most tables have a primary key, always just one column.

Some tables have references (foreign keys)

When I ReadXml("filename) I get the DataException "Invalid 'Key' node inside
constraint named: AgentListRecentList.

Looking at the xml file I see no "Key" node inside AgentListRecentList:

      <xs:keyref name="AgentListRecentList" refer="AgentKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="SetNull">
        <xs:selector xpath=".//mstns:RecentList" />

      </xs:keyref>

There is an element matching the 'refer' attribute:

      <xs:unique name="AgentKey">
        <xs:selector xpath=".//mstns:AgentList" />

      </xs:unique>

(It strikes me now that the xs:keyref element lacks
`msdata:UpdateRule="Cascade" .)

Any help is greatly appreciated

Thanks, Enrqiue



Wed, 07 Dec 2005 21:51:22 GMT  
 Cannot DataSet.ReadXml a file written with DataSet.WriteXml

Quote:
> I have defined a dataset using the dataset designer, using
> Element for tables and Attribute for columns. All columns are String.

> I do no operations that modify the schema in the application.
> The DataSet is strongly typed, and the corresponding class is genereated
> automatically by VS from the dataset schema (xds) file.

> Most tables have a primary key, always just one column.

> Some tables have references (foreign keys)

> When I ReadXml("filename) I get the DataException "Invalid 'Key' node
inside
> constraint named: AgentListRecentList.

I can read the file if I use the IgnoreSchema option.

Regards, Enrqiue



Wed, 07 Dec 2005 23:46:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to strip white spaces, line characters from xml file (written by dataset.writexml)

2. dataset : cannot fil the dataset because the field is empty

3. PRB: XML - Dataset - Save CDATA with .WriteXML()

4. Load XML to MSXML2.DOMDocument from DataSet.WriteXML?

5. Dataset ReadXml method

6. How to generate dataset class from dataset xsd file

7. To DataSet or Not to DataSet

8. dataset problems - cant update sql after editing dataset

9. Insert dataset into dataset

10. I cannot believe no one knows how to pass a dataset or datatable to Crystal

11. Write back a record from a Dataset

12. how to write xml for single table in dataset

 

 
Powered by phpBB® Forum Software