Although XML continues to gain popularity throughout the world, companies still store much of their data in relational databases. This can present a problem when the relational data needs to be converted into a hierarchical structure in order to be used in an application. Several different techniques can be employed to handle this conversion effort including leveraging SQL Server 2000 XML capabilities, generating a hierarchical structure using code, plus others.
This sample application demonstrates how the DataSet and DataRelation classes can be used along with XSLT to convert relational data into a hierarchical XML structure that can be consumed by a TreeView Web Control that holds customer and order information. The sample relies upon the DataSet and DataRelation classes to establish hierarchical relationships and transforms the data into TreeView compatible XML. using XSLT as well as other ADO.NET techniques. Web Services and the IE Web Service Behavior are also used to allow users of the application to retrieve customer/order data without having to refresh the page each time they click an entry in the TreeView control. Browsers not capable of running the Web Service Behavior are also supported.