It is possible to shape your XML from SQL and retrieve it with ADO.NET
Here is a very small sample using the northwind database
<sql
SELEC
FirstName
LastName
Territories.TerritoryDescription
Region.RegionDescriptio
FRO
Employee
JOIN EmployeeTerritorie
ON Employees.EmployeeID = EmployeeTerritories.EmployeeI
JOIN Territorie
ON Territories.TerritoryID = EmployeeTerritories.TerritoryI
JOIN Region
ON Territories.RegionID = Region.RegionI
FOR XML AUT
<C#
System.Xml.XmlDocument doc = new XmlDocument()
System.Data.SqlClient.SqlConnection con = new SqlConnection("Integrated Security=SSPI;database=northwind;server=.")
System.Data.SqlClient.SqlCommand cmd = new SqlCommand("EmployeeList", con)
con.Open()
doc.LoadXml( "<xml>" + cmd.ExecuteXmlReader().ReadString() + "</xml>")
con.Close()
Which will give you three level looking like this
<Region RegionDescription="Eastern"><Territories TerritoryDescription="Bedford"><Employees FirstName="Andrew" LastName="Fuller"/><!-- ... --></Territories></Region
If you just want to view the xml in IE, you can save it as a document and open the document.
Here is good walk through for how to save the xml document as a file.
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/xmlfromsqlsrv.asp
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.ht
----- Victor Rodriguez wrote: ----
Is it possible to generate a XML from a join of three tables joi
sequentially 1-->2-->3 and represent them as a treeview on XML
Victo