简体   繁体   English

在 C# WinForms 中将数据从数据库插入和检索到 TreeView 控件

[英]Insert and retrieve data from database to TreeView control in C# WinForms

I am working with a project, in which I have a task that Names represents with hierarchy in a treeview control.我正在处理一个项目,在该项目中,我有一个任务,名称在树视图控件中用层次结构表示。

That means I must able to add the parent and child nodes to treeview and when I click Save button all the nodes should be stored in database.这意味着我必须能够将父节点和子节点添加到树视图中,当我单击“保存”按钮时,所有节点都应存储在数据库中。

My typical task is, if I retrieve the data, all the parent and child node should retrieved and added to the treeview control as I inserted hierarchy only.我的典型任务是,如果我检索数据,则所有父节点和子节点都应该检索并添加到树视图控件中,因为我只插入了层次结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM