Click here to Skip to main content
15,896,526 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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;

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.
Posted
Updated 25-May-11 21:35pm
v3

1 solution

Start here[^]: you should be able to adapt the code to your needs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900