K
keith chadwick
The system I am converting use a lot of sql that makes use of the for xml
clause provided for in sql server 2000. Below is an example of how this is
done in ASP:
set dataxml=server.CreateObject("MSXML2.DOMDocument.4.0")
dataxml.setProperty "ServerHTTPRequest", false
dataxml.async=false
dim sSQL
sSQL = "<?xml version=""1.0"" ?><ROOT
xmlns:sql=""urn:schemas-microsoft-com:xml-sql"">"
sSQL = sSQL & "<clients><sql:query>select * from client order by name for
xml auto</sql:query></clients>"
sSQL = sSQL & "<events><sql:query>select * from event order by name for xml
auto</sql:query></events>"
sSQL = sSQL & "</ROOT>"
set cmd=server.CreateObject("ADODB.COMMAND")
cmd.ActiveConnection=application("DBCONNECTION")
cmd.CommandText=sSQL
cmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"
cmd.Properties("Output Encoding")="ISO-8859-1"
cmd.Properties("XSL")="myxsltfile.xslt"
cmd.Properties("Output Stream")=dataxml
cmd.Execute ,,1024
In the above example a transformation is being applied and the result being
placed inset the msxsml object for further processing.
In other cases we do not immediately apply a xsl and simply set the Output
Streeam to Response.
How would I go about this in .NET with the same results?
Thanks in Advance
Keith
clause provided for in sql server 2000. Below is an example of how this is
done in ASP:
set dataxml=server.CreateObject("MSXML2.DOMDocument.4.0")
dataxml.setProperty "ServerHTTPRequest", false
dataxml.async=false
dim sSQL
sSQL = "<?xml version=""1.0"" ?><ROOT
xmlns:sql=""urn:schemas-microsoft-com:xml-sql"">"
sSQL = sSQL & "<clients><sql:query>select * from client order by name for
xml auto</sql:query></clients>"
sSQL = sSQL & "<events><sql:query>select * from event order by name for xml
auto</sql:query></events>"
sSQL = sSQL & "</ROOT>"
set cmd=server.CreateObject("ADODB.COMMAND")
cmd.ActiveConnection=application("DBCONNECTION")
cmd.CommandText=sSQL
cmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"
cmd.Properties("Output Encoding")="ISO-8859-1"
cmd.Properties("XSL")="myxsltfile.xslt"
cmd.Properties("Output Stream")=dataxml
cmd.Execute ,,1024
In the above example a transformation is being applied and the result being
placed inset the msxsml object for further processing.
In other cases we do not immediately apply a xsl and simply set the Output
Streeam to Response.
How would I go about this in .NET with the same results?
Thanks in Advance
Keith