M
Markus Heid
Hi,
I've got an application in which I transform some semicolon separated
information into xml and then load it into a dataset: The XSD for the XML
Looks this way:
<?xml version="1.0" standalone="yes" ?>
<xs:schema id="trace" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="trace" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="filter">
<xs:complexType>
<xs:sequence>
<xs:element name="dtsbegin" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
</xs:complexType>
</xs:element>
<xs:element name="dtsend" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="errors">
<xs:complexType>
<xs:sequence>
<xs:element name="error" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
<xs:attribute name="category" type="xs:string" />
<xs:attribute name="module" type="xs:string" />
<xs:attribute name="device" type="xs:string" />
<xs:attribute name="message" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
This works well. The XML is filled with valid information. But when I quit
my program I get in 9 from 10 times following exception:
An unhandled exception of type 'System.ArgumentException' occurred in
system.data.dll
Additional information: Relation errors_error does not belong to this
DataSet.
This is my code for loading the xml into the dataset:
XmlTextReader xr = new XmlTextReader( sb.ToString(), XmlNodeType.Document,
null );
DataSet xmlSet = new DataSet();
xmlSet.ReadXmlSchema( "d:\\xsd\\opresolve.xsd" );
xmlSet.ReadXml( xr );
//xmlSet.WriteXmlSchema( ".\\opresolve.xsd" );
return( xmlSet );
Has anyone an idea what could be wrong?
Thanks in Advance
Dipl-Inf(FH)
Markus Heid
LogASys mbH
Georg-Mayr-Str 9
97828 Marktheidenfeld
Tel.: 09391/9896-616
Web: www.logasys.de
P.S I'm using VS 2003 with the 1.1 Framework
I've got an application in which I transform some semicolon separated
information into xml and then load it into a dataset: The XSD for the XML
Looks this way:
<?xml version="1.0" standalone="yes" ?>
<xs:schema id="trace" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="trace" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="filter">
<xs:complexType>
<xs:sequence>
<xs:element name="dtsbegin" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
</xs:complexType>
</xs:element>
<xs:element name="dtsend" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="errors">
<xs:complexType>
<xs:sequence>
<xs:element name="error" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="dts" type="xs:dateTime" />
<xs:attribute name="category" type="xs:string" />
<xs:attribute name="module" type="xs:string" />
<xs:attribute name="device" type="xs:string" />
<xs:attribute name="message" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
This works well. The XML is filled with valid information. But when I quit
my program I get in 9 from 10 times following exception:
An unhandled exception of type 'System.ArgumentException' occurred in
system.data.dll
Additional information: Relation errors_error does not belong to this
DataSet.
This is my code for loading the xml into the dataset:
XmlTextReader xr = new XmlTextReader( sb.ToString(), XmlNodeType.Document,
null );
DataSet xmlSet = new DataSet();
xmlSet.ReadXmlSchema( "d:\\xsd\\opresolve.xsd" );
xmlSet.ReadXml( xr );
//xmlSet.WriteXmlSchema( ".\\opresolve.xsd" );
return( xmlSet );
Has anyone an idea what could be wrong?
Thanks in Advance
Dipl-Inf(FH)
Markus Heid
LogASys mbH
Georg-Mayr-Str 9
97828 Marktheidenfeld
Tel.: 09391/9896-616
Web: www.logasys.de
P.S I'm using VS 2003 with the 1.1 Framework