XML & SQL Server 2k Questions

wxdqz

New Member
Hello there,

I'm a complete newbie to XML, and I'm trying to start out with something simple. I want to do the following:
1) Create an XML page that queries a SQL Server 2000 DB table and assign variables/parameters for each returned values in a loop.
2) Use an ASP.NET page to pull in that raw data from an XML file, and display the returned values.
3) Use XSLT stylesheets to allow users to view the data in different browsers/formats.

This is what I've come up with so far:
XML PAGE (datapage.xml):
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
<sql:query>SELECT * FROM TABLENAME FOR XML AUTO</sql:query>
</root>

ASP.NET PAGE (resultspage.aspx):
<html>
<body>
<xml id="data" src=http://www.webdeveloper.com/forum/archive/index.php/"datapage.xml"></xml>
<?xml-stylesheet type="text/xsl" href="ie6.xsl" ?>
<table border="1" datasrc="#data">
<tr>
<td><span datafld="FIELD1"></span></td>
<td><span datafld="FIELD2"></span></td>
</tr>
</table>
</body>
</html>
But when I view the XML page in IE6, it doesn't display records from the DB table, but just this:
<?xml version="1.0" encoding="UTF-8" ?>
- <root xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<sql:query>SELECT * FROM TABLENAME AS RESULTSNAME FOR XML AUTO, ELEMENTS</sql:query>
</root>
Am I on the right track? What steps am I missing, and where can I find more information on this type of setup? Thanks for any advice.
 
Back
Top