Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hi.
How can i populate asp:treeview only child populate with database query like "select databasename from databse where user_id="45" " and show these database in child treeviewm.Here is image image
I want database remain same and blow child databsename,database name all shown blow,only 1st,3,4 database shown just,Kindly tell me how can i do this,Thanks.I search on google but i can't find this.Thanks

What I have tried:

I try this link but i can't figure out how to start
http://www.aspsnippets.com/Articles/Populate-Bind-TreeView-from-database-in-ASPNet.aspx
Posted
Updated 1-Apr-16 3:41am
Comments
ZurdoDev 1-Apr-16 8:20am    
I don't understand what your question is.
Hameed Khan 1-Apr-16 8:23am    
How can i populate only child notes "database name" ,as shown in image with database source query lik "select ... " etc

1 solution

To read the list of database names from server
SQL
SELECT name FROM master.dbo.sysdatabases


for binding data to the Treeview refer below
Populate (Bind) TreeView from database in ASP.Net[^]
Populating a TreeView Control from the Database[^]
 
Share this answer
 
Comments
Hameed Khan 1-Apr-16 14:11pm    
I also visit these website,but i need only child nodes populate
Karthik_Mahalingam 1-Apr-16 14:18pm    
so what you have tried
Hameed Khan 2-Apr-16 9:08am    
Thankss alot,,it's working now

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