C#编写XML Datagrid视图 [英] C# Write XML Datagrid View

查看:79
本文介绍了C#编写XML Datagrid视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我目前正在尝试将数据库表的内容写入XML文件.可以做到这一点,但是我想要实现的是在数据网格视图中显示信息,允许用户更改或添加任何记录,然后能够将数据库表的内容写到XML文件中.

有任何想法吗?

Hi guys, Im currently trying to write the contents of my database table to an XML file. This can be done, however what I am trying to achieve is to display the information in a datagrid view, allow the user alter or add any records, and then be able to write out the contents of the database table, to an XML file.

Any Ideas?

Would be much appreciated

推荐答案

,请参阅本文
http://www.dotnetheaven.com/uploadfile/prathore/datagridview09122007013411am/datagridview.aspx [ ^ ]
其中显示了如何显示XML 文件中DataGridView中的数据.
现在,在对数据进行修改和/或在DataGridView中添加新数据之后,可以使用以下代码将数据写回到磁盘上的XML文件中,以获得上述文章中提到的文件名. />
Please see this article
http://www.dotnetheaven.com/uploadfile/prathore/datagridview09122007013411am/datagridview.aspx[^]
in which it is shown how to display the data in a DataGridView from an XML file.
Now, after making the modifications to the data and / or adding new data in the DataGridView, the following code can be used to write the data back to the XML file on disk for the file name referred to in the above article
xmlDatadoc.DataSet.WriteXml(Application.StartupPath + "\\books.xml");


这篇关于C#编写XML Datagrid视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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