CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

add node in treeview nad display topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2010, 05:05 AM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
virusisfound is on a distinguished road
| More
add node in treeview nad display

Hi,

I am working on tree View in taht i want to do two thinks i.e
1. add new node at run time
2. what data is stored in a database is shown in the tree view as parent node and
its child

for second i have do some coding it shows data as parent and child node but problem is it shows only one row record can any one help me correct the coding please

Code:
   SqlConnection con = new SqlConnection("USER=userid;PASSWORD=password;SERVER=servername;DATABASE=database");
            string SQLQuery;
            SQLQuery = "select tablename,displayname from Tablename";
            DataSet ds=new DataSet();
            SqlDataAdapter da=new SqlDataAdapter(SQLQuery,con);
            da.Fill(ds);
            foreach ( DataRow Row in ds.Tables[0].Rows)
            {
                TreeNode Tnode = new TreeNode("ParentNode");
                treeView1.Nodes.Add(Tnode);
}
Thanks.....

Last edited by shabbir; 09-02-2010 at 05:06 AM. Reason: Code Blocks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I display a data structure in GUI turkim MFC Programming 0 08-29-2010 03:12 PM
Question about TreeView Control patkhor Win32 Programming 0 08-28-2010 03:00 PM
using DataSet to fill a treeview cgcgames C# Programming 0 08-28-2010 03:11 AM
Exporting Treeview data to excel sheet using C# ashasivan C# Programming 0 08-28-2010 03:00 AM
display Text on right side kinnera MFC Programming 3 01-24-2010 10:49 PM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 04:51 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board