Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1090
  • Last Modified:

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
0
GIANTOCR
Asked:
GIANTOCR
2 Solutions
 
Manoj PatilSr. Software EngineerCommented:
0
 
Meir RivkinFull 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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now