Hello,
I have a Client/Server system based on a single generic communication method
using XML (as done in MS Project-Server or SharePoint-WebServices).
To transfer DataSets I'am using XmlDataDocument.
This works fine.
However the created XmlDataDocument does not contain schema information,
i.e. the datatypes of the columns in the dataset-tables are lost.
Is there any way to include the shema info?
(I cannot use dataSet.WriteXml because I don't need a file or stream, I need
a XmlDocument!)
Thank you
Wolfgang
Code fragment:
// Create dataset or get it from database
DataSet dataSet = GetDataSet();
// Test: Write to file, including schema information
dataSet.WriteXml("C:\\test1.xml", XmlWriteMode.WriteSchema);
// Create XML document from dataset, does obviously NOT include schema
information!
XmlDataDocument xDoc = new XmlDataDocument(dataSet);
// Normally the XmlDocument will be returned here
// return xDoc;
// Test: Write to file: has NO schema information
xDoc.Save("C:\\test2.xml");