Load Treeview with data from SQL Server

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
GIANTOCRAsked:
Who is Participating?
 
Manoj PatilConnect With a Mentor Sr. Software EngineerCommented:
0
 
Meir RivkinConnect With a Mentor Full stack Software EngineerCommented:
0
 
GIANTOCRAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.