How can I make sure that when I write a DateTime value to an xml file from a dataset with dataset.WriteXml, I can subsequently retrieve a DateTime into a new dataset using dataset.ReadXm开发者_如何转开发l. At the moment I appear to get a String holding the date and time.
Any thoughts Richard
When you write the XML, use the overloaded function with XmlWriteMode.WriteSchema. That should preserve your types when you serialize and deserialize.
DataSet1.WriteXml(fileName, XmlWriteMode.WriteSchema);
精彩评论