Solved

Load Treeview with data from SQL Server

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 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

9 Experts available now in Live!

Get 1:1 Help Now