Solved

Load Treeview with data from SQL Server

Posted on 2013-01-13
3
1,016 Views
Last Modified: 2013-01-15
I would like to use a treeview to display hierarchical data stored in SQL Server.

The treeview only accepts SiteMapDataSource or XmlDataSourceas a datasource.

Is there an easy way to load either one of these datasources from SQL Server?

Thanks
0
Comment
Question by:GIANTOCR
3 Comments
 
LVL 19

Accepted Solution

by:
Manoj Patil earned 250 total points
ID: 38771934
0
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 250 total points
ID: 38772046
0
 

Author Closing Comment

by:GIANTOCR
ID: 38781154
Thanks for the help.

What I ended up doing was writing a SQL Server Query that returns my data in a XML file.

I then made the XML file the datasource for an XMLDataSource.

I then made the XMLDataSource the datasource for the Treeview.

Both of the solutions you presented would also do it but I was looking for the minimum coding. As I get deeper into this project I may end up using the iterative approaches you recomended.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now