Serializing fields in a custom DataSet to XML

坚强是说给别人听的谎言 提交于 2020-01-05 06:52:07

问题


Is there any way to add fields to a DataSet which will be serialized along with the table information when the DataSet is serialized in XML? I have some information that describes the DataSet that I want to try to include inside it when I throw it around in XML. I've tried adding fields and classes in the partial class Visual Studio generates for you for validation methods but I can't seem to get them to show up alongside the table information in the XML file either when myDataSet.WriteXML() or I use an XMLSerializer.


回答1:


I haven't ever tried it, but the ExtendedProperties property of DataSet is supposed to be just for this. It lets you store information which is persisted when the DataSet is serialised to XML.



来源:https://stackoverflow.com/questions/1408517/serializing-fields-in-a-custom-dataset-to-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!