How to write XmlReader data to a web page?
Here is an example:
//For example SQL server is returning some data from this
//simple stored procedure. It returns XML:
SELECT * FROM MySQLTable
FOR XML AUTO
// Capture the return value in an XmlReader like so:
XmlReader xmlr = mySqlCommand.ExecuteXmlReader();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlr)
//send it to webpage
Response.write(xmlDoc.InnerXml)
Back to
XML FAQ