Solved

Load Treeview with data from SQL Server

Posted on 2013-01-13
3
1,044 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

679 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