在自定义的DataSet XML序列化领域 [英] Serializing fields in a custom DataSet to XML

查看:108
本文介绍了在自定义的DataSet XML序列化领域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将字段添加到数据集,这将可与表中的信息序列以及如果数据集连载中的XML?我有一个介绍,我想尝试在它里面包含的时候我在XML周围扔DataSet中的一些信息。我试着在部分二级Visual Studio中添加字段和类为您生成的验证方法,但我似乎无法让他们露面旁边的XML文件中的表中的信息既可以当myDataSet.WriteXML()或我使用一个XmlSerializer。

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.

推荐答案

我还没有尝试过,但是的数据集的ExtendedProperties 属性应该是只是为了这个。它可以让你存储在数据集序列化为XML是持久的信息。

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.

这篇关于在自定义的DataSet XML序列化领域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆