[英]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.我的典型任务是,如果我检索数据,则所有父节点和子节点都应该检索并添加到树视图控件中,因为我只插入了层次结构。
Go through following links it might get you started to come with real question.通过以下链接,它可能会让您开始提出真正的问题。
http://msmvps.com/blogs/deborahk/archive/2009/11/09/populating-a-treeview-control-from-a-list.aspx http://msmvps.com/blogs/deborahk/archive/2009/11/09/populating-a-treeview-control-from-a-list.aspx
http://www.codeguru.com/csharp/csharp/net30/article.php/c15887/Updating-a-Database-from-WinForms-Controls-Old-School.htm http://www.codeguru.com/csharp/csharp/net30/article.php/c15887/Updating-a-Database-from-WinForms-Controls-Old-School.htm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.