add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2007
Posts: 16
Reputation: rinkuchoudhury is an unknown quantity at this point 
Solved Threads: 0
rinkuchoudhury rinkuchoudhury is offline Offline
Newbie Poster

add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0

 
0
  #1
Mar 26th, 2007
hi
I have to add nodes and subnodes to a tree view from sql database in asp.net(VB.Net) 2.0

How to do this
i have 3 tables
i want to add nodes from first table and respective childnodes from the 2nd table subsiquent child nodes from the 3rd table

how to do this
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0

 
0
  #2
Mar 26th, 2007
The easiest way is to write a query to select the data from all 3 tables and put them into a dataset with relationships.
Then you just have to iterate through the first table one row at a time and create a node for it. Then run through that rows child rows one at a time and create a node for them and add them to the parent node, and run through each of the child rows of those rows and do the same.
In pseudo code (as i am more a C# than Vb person)
  1. ..Create Dataset with 3 tables and 2 relationships
  2. Create a top node
  3. For each table1row in table1
  4. Create table1node
  5. Add it to topnode's node
  6. for each table2row in table1row.getchildrows()
  7. Create table2node
  8. Add it to table1node
  9. for each table3row in table2row.getchildrows()
  10. Create table3node
  11. end table3row for each
  12. end table2row foreach
  13. end table1row foreach
  14.  
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 1
Reputation: bassam572009 is an unknown quantity at this point 
Solved Threads: 0
bassam572009 bassam572009 is offline Offline
Newbie Poster

Re: add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0

 
0
  #3
Jul 20th, 2009
if you have sample in asp.net and use vb lang
pls
send me by e-mail
<EMAIL SNIPPED>
Last edited by peter_budo; Jul 20th, 2009 at 12:09 pm. Reason: Keep It On The Site - Do not post asking for an answer to be sent to you via email or PM.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC