如何在数据库中保存treeview节点更改? [英] how to save treeview node change in a tabble of database?

查看:176
本文介绍了如何在数据库中保存treeview节点更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个链接到树视图的组织结构图。当我更改我的图表的节点(whit拖放)时,treeview节点也变为chenged。

现在我想将treeview的这些更改保存到我的数据库表(sql server)中。我的表的字段是(id,parentid,text,value)如何在mytable中保存treeview节点? div class =h2_lin>解决方案

尝试序列化为XML并保存整个结构而不是分解它:使用XmlTextWriter和XmlTextReader将TreeView控件加载并保存到XML文件中[ ^ ]

Hi I have a organisation chart that link to a treeview. when I change node of my chart(whit drag and drop), treeview node also chenged.
now I want save this changes of treeview to my table in database(sql server).The fields of my table is (id, parentid,text,value )how to save treeview node in mytable?

解决方案

Try serializing to XML and saving the whole structure instead of breaking it up : Loading and Saving a TreeView control to an XML file using XmlTextWriter and XmlTextReader[^]


这篇关于如何在数据库中保存treeview节点更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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