Hi,
I've got following XML-XSD:
Fitting XML-Data would look that way:Code: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:element name="stack" minOccurs="0" maxOccurs="unbounded"> xs:complexType> xs:attribute name="id" type="xs:string" /> /xs:complexType> /xs:element> /xs:sequence> /xs:complexType> /xs:element> xs:element name="log"> xs:complexType> xs:sequence> xs:element name="move" minOccurs="0" maxOccurs="unbounded"> xs:complexType> xs:attribute name="stack" type="xs:string" /> xs:attribute name="src" type="xs:string" /> xs:attribute name="dst" type="xs:string" /> xs:attribute name="srcpos" type="xs:string" /> xs:attribute name="dstpos" type="xs:string" /> xs:attribute name="dtsbegin" type="xs:dateTime" /> xs:attribute name="dtsend" type="xs:dateTime" /> xs:attribute name="srcdvc" type="xs:string" /> xs:attribute name="dstdvc" type="xs:string" /> xs:attribute name="carrier" type="xs:string" /> /xs:complexType> /xs:element> /xs:sequence> /xs:complexType> /xs:element> /xs:choice> /xs:complexType> /xs:element> /xs:schema>
I load these data with following lines of code into a DataSet:Code:trace> filter> dtsbegin dts="2003-10-04T12:00:00" /> dtsend dts="2003-10-14T12:00:00" /> stack id="" /> /filter> log> move stack="5236.3112.2359" src="71" dst="94" srcpos="17" dstpos="41" dtsbegin="2003-06-10T10:25:53" dtsend="2003-06-10T10:30:25" srcdvc="500000" dstdvc="500000" carrier="5504" /> move stack="5236.3112.2359" src="31" dst="4" srcpos="10" dstpos="14" dtsbegin="2003-06-10T10:25:25" dtsend="2003-06-10T10:34:58" srcdvc="500000" dstdvc="500000" carrier="5501" /> /log>/trace>
Code:XmlTextReader xr = new XmlTextReader( sb.ToString(), XmlNodeType.Document, null ); DataSet xmlSet = new DataSet(); xmlSet.ReadXmlSchema( "d:\\xsd\\moveresolve.xsd" ); xmlSet.ReadXml( xr ); //xmlSet.WriteXmlSchema( ".\\moveresolve.xsd" ); return( xmlSet );
This works well, but when i my program is terminates I've got following exception:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: Relation log_move does not belong to this DataSet.
Has anyone an idea what causes that exception and how to solve that problem?
Thanks in Advance
Akademos


Reply With Quote