本文介绍了如何对树子进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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.
更多推荐
如何对树子进行排序
发布评论