Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSet looses digits sepecified in Schema for Decimal types
Message
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
DataSet looses digits sepecified in Schema for Decimal types
Miscellaneous
Thread ID:
00918602
Message ID:
00918602
Views:
40
Hi,

I use the VFP XmlAdapater to create an XML DataSet that is sent to a .NET application through a webservice, on the other site I use a DataSet.ReadXML call to load the data into my dataset. Later I use a DataSet.WriteXML call to send back the data to VFP. Everything works fine except the decimals, both VFP and .NET messes with them!

I did this to check for the differences between the XML files generated by both, and below the code I pasted all numeric fields from both the Vfp.xml and Dotnet.xml files


'Writes to disk the XML received from VFP
Dim oStream As New StreamWriter("vfp.xml")
oStream.Write(cXML)
oStream.Close()
'Loads XML received from VFP in a new DataSet
Dim oDS As New DataSet("VFPDataSet")
Dim oXMLTR As New XmlTextReader(New StringReader(cXML))
'oDS.ReadXmlSchema(oXMLTR)
oDS.ReadXml(oXMLTR, XmlReadMode.ReadSchema)
oDS.AcceptChanges()

'Writes to Disk XML of the DataSet
Dim oFileStream As New FileStream("dotnet.xml", _
    FileMode.Create, FileAccess.Write)
Dim oXMLTW As New XmlTextWriter _
    (oFileStream, System.Text.Encoding.UTF8)
oDS.WriteXml(oXMLTW, XmlWriteMode.WriteSchema)
oXMLTW.Close()
oFileStream.Close()
In the Vfp.xml file, for all restriction base="sxd:decimal", both the Totaldigits and fractiondigits are present and corresponding to the backend databases, but in Dotnet.xml, for all decimal fields, the totalDigits and FractionDigits fields disappeared! So when I load back in VFP, all numeric fields ends up being N(20,19)...

Can anybody help me ? Why is that and how can I fix that ?

Thanks,
Sylvain Bujold
Next
Reply
Map
View

Click here to load this message in the networking platform