如何从 SQL Hierarchyid 构建 ac# 树视图?

发布于 2024-10-05 06:48:43 字数 299 浏览 0 评论 0原文

我正在开发一个 C# .NET Windows 窗体应用程序,它将管理分层树视图结构。 (我有一个带有 Hierarchyid 列的 SQL 表。目前数据集很小,约 300 行/节点,但最终肯定会变大)

退出应用程序后,我希望能够使用以下命令重新启动它:最后修改的状态。我知道我可以通过将其序列化为 XML 来做到这一点。

但是,我试图找到一种方法,可以使用层次结构 id 列在运行时直接从表生成树视图。

在谷歌搜索后,我发现其他一些人也有同样的愿望,但不幸的是我没有找到解决方案。有没有好的方法可以做到这一点?

谢谢。

I'm developing an C# .NET Windows Form application that 'll manage a hierarchical tree-view structure. (I have a single SQL table with a hierarchyid column. The data set is small ~300 rows/nodes at the moment, but is bound to grow large eventually)

After I exit the application, I want to be able to restart it with the last modified state. I understand I can do this by serializing it to XML.

However, I'm trying to find a method by which the treeview could be generated directly from the table at run time, using the hierarchy id column.

After Googling around, I've found some others who wish to the same, but unfortunately I've found no solutions. Is there a good way to do this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫嚣ゝ 2024-10-12 06:48:44

查找 IHierarchicalEnumerable、HierarchicalDataSourceControl 和 HierarchicalDataSourceView。这正是您要寻找的。

Look for IHierarchicalEnumerable, HierarchicalDataSourceControl and HierarchicalDataSourceView. Thats exactly what are you looking for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文