If you were sending XML to be inserted into HTML, you'd set the ContentType :
Response.Conten tType = "text/xml";
Response.Conten tEncoding = Encoding.UTF8;
But, since what you want to do is send a file, not render it, you need to serialize the objects
to a memory stream and then send the bytes in the memory stream buffer over the TCP connection.
See this article for sample code :
http://www.thescripts.com/forum/thread178613.html
There's more sample code at :
http://www.developerfusion.co.uk/show/4415/5/
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== =====
"ad" <fl****@wfes.tc c.edu.twwrote in message news:eI******** ******@TK2MSFTN GP03.phx.gbl...
>I create a MemoryStream form a dataset:
MemoryStream sm= new MemoryStream();
dsHealth.WriteX ml(sm);
I use
Response.Write( )
to send this XML MemoryStream as file to client.
What is the ContentType of Response I must set?