Hi, I'm creating a XML DataSet from my destktop application:
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<MyDataSet>
<xsd:schema id="MyDataSet" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="MyDataSet" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="TestData" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rowid">
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="5"/>
<xsd:fractionDigits value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
...
and then, from my WinCE / NetCF 2.0 application, I'm reading the XML Data using
ds = new DataSet();
ds.ReadXML(sXMLFile, XmlReadMode.ReadSchema);
but when I save the data with
ds.WriteXML (sXMLFile, XMLWriteMode.WriteSchema);
the XML generated looks like this:
<?xml version="1.0" standalone="yes"?>
<MyDataSet>
<xs:schema id="MyDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="MyDataSet" msdata:IsDataSet="true" msdata:Locale="en-US">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="TestData" minOccurs="0" maxOccurs="79228162514264337593543950335">
<xs:complexType>
<xs:sequence>
<xs:element name="rowid">
<xs:simpleType>
<xs:restriction base="xs:decimal" />
</xs:simpleType>
</xs:element>
...
that is, all the numerical fields are converted from integer values (xsd:decimal / totalDigits:n / fractionDigits:0) to decimal values (xs:decimal). This is causing me a lot of pain in the desktop app.
Am I doing something wrong?