•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,524 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,479 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5471 | Replies: 1
![]() |
| |
•
•
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation:
Rep Power: 3
Solved Threads: 10
Re: add nodes and subnodes to a treeview from sql database by coding in asp.net 2.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)
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp avatar backup code coding combo competition compilers computer custom daniweb data database design developer developers development dropdownlist errors feed google government hacker languages medicine microsoft module net news normalization office programming reader reuse sans search security server skin software sql survey theme vista web xoap
- Problem Inserting into SQL database on server (ASP.NET)
- Adding a column to an SQL database (VB.NET)
- Convert XML data to sql table through coding in ASP.Net2.0 (Techies' Lounge)
- Insert into sql database (ASP.NET)
- Beginner: Insert, Update, Delete & Search records from/to sql database (ASP.NET)
- URGENT!: Saving Database information from ASP.NET Button (ASP.NET)
- Help with Roles Stored in SQL database (ASP.NET)
- Snyc'n Local SQL database online (MS SQL)
Other Threads in the ASP.NET Forum
- Previous Thread: need help with sql database in asp.net using VB
- Next Thread: Passing An Connecting String


Hybrid Mode