How to write XML from a SQL Server query, to a ASP.NET textBox

D

drlexkingdome

I'm trying to do this:

-------------------------------------
1) Have SQL server return some data from this
simple stored procedure. It returns XML:

SELECT * FROM eAccessTypes
FOR XML AUTO

-------------------------------------
2) In my C# I capture the return value in
an XmlReader like so:

XmlReader xmlr = mySqlCommand.ExecuteXmlReader();

-------------------------------------
3) But I cant figure out how to get the xml
from the XmlReader and into a string
variable so I can just display it on a
web page. ? Please Help!

I've found many examples that show how to write the xml to a file or to
a stream, but not just to a simple string variable. Any help with code
examples would be a godsend! Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top