如何编辑包含xml值的数据集 [英] How to edit the dataset that containing xml values

查看:91
本文介绍了如何编辑包含xml值的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海,

我已经成功地将xml文件转换为数据集.但是与此同时,我想编辑以数据集表示的值.众所周知,在sql数据源中很容易编辑.但是这里是xml数据源.帮助我

Hai,

I am successfully convert the xml files into dataset.But at the same time i want to edit this values represented in dataset.As we know it is easy to edit in sql datasource.But here it is xml datasource.How to edit this?plz help me

推荐答案


如果您使用数据集的ReadXml(),则该数据集将根据您的XML结构填充数据表.因此,在编辑网格时,绑定控件会自动更新表.如果使用编辑项目"模板,则在gridview的更新"事件中填充数据集表.然后调用数据集的 WriteXml()方法来更新xml.将gridview与更新的数据集绑定.

如有疑问,请发表评论.
Hi
If you use the Dataset''s ReadXml() then that dataset will be populated with data tables as per your XML structure. So when editing the grid, the bound control update the tables automatically. If you use a Edit Item template then at the gridview''s Updating event populate the datasets tables. Then call the Dataset''s WriteXml() method to update the xml. Bind the gridview with updated dataset.

If any doubt post comments.


这篇关于如何编辑包含xml值的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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