如何对树子进行排序

编程入门 行业动态 更新时间:2024-10-24 00:27:19
本文介绍了如何对树子进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

List<string> retList = new List<string>(); FilterName.Clear(); string connectionString = "Provider=Microsoft.JET.OLEDB.4.0;data source=" + strPath; OleDbConnection conn = new OleDbConnection(connectionString); string sql = "SELECT DISTINCT "+stringColName+" From " + strTable; OleDbCommand cmd = new OleDbCommand(sql, conn); conn.Open(); OleDbDataReader reader; reader = cmd.ExecuteReader(); TreeNode tn = null;

朋友你好. 我们使用数据库.即Provider = Microsoft.JET.OLEDB.4.0; 我的应用程序还从数据库甚至树节点中获取了整个数据.. 我想知道如何对树状子进行排序... 代码是:

hello friends. we use a database.i.e Provider=Microsoft.JET.OLEDB.4.0; my application fetch the whole data from the database even tree node also.. i want to know how to do the sorting of tree child... code is :

List<string> reeList = new List<string>(); FilterName.Clear(); string connectionString = "Provider=Microsoft.JET.OLEDB.4.0;data source=" + strPath; OleDbConnection conn = new OleDbConnection(connectionString); string sql = "SELECT DISTINCT "+stringColName+" From " + strTable; OleDbCommand cmd = new OleDbCommand(sql, conn); conn.Open(); OleDbDataReader reader; reader = cmd.ExecuteReader(); TreeNode tn = null; tn=new TreeNode(ParentNode); while(reader.Read()) { tn.Nodes>Add(reader.GetString(0),reader.GetString(0)) FilterName.Add(reader.GetString(0)); }</string></string>

请告诉我这段代码是如何完成树孩子的工作的.

please tell me how this code do the sort of tree child.

推荐答案

开始此处 [ ^ ]:您应该能够使代码适应您的需求. Start here[^]: you should be able to adapt the code to your needs.

更多推荐

如何对树子进行排序

本文发布于:2023-10-15 02:46:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1493016.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!