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

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)

..Create Dataset with 3 tables and 2 relationships
Create a top node
For each table1row in table1
Create table1node
Add it to topnode's node
for each table2row in table1row.getchildrows()
Create table2node
Add it to table1node
for each table3row in table2row.getchildrows()
Create table3node
end table3row for each
end table2row foreach
end table1row foreach

if you have sample in asp.net and use vb lang
pls
send me by e-mail
<EMAIL SNIPPED>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.