Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: creating XML feed

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 9/11/2007 6:29:00 PM

shank wrote:

> I'm using that statement to generate the XML code. I'm trying to generate 
> that code then pass to our users out of convenience for them. However, the 
> size of the generated code is HUGE and I'm having problems making it a 
> convenient download. Once I get it into a database field, it's so large that 
> browsers timeout trying to access it.

Not sure how you do it but "get it into a database field" sounds 
strange, you should use the ExecuteXmlReader method of an SqlCommand 
object (with e.g. SELECT col1, col2, ..., col2 FROM table FOR XML AUTO, 
ROOT), then if you want to pass on that XML within an ASP.NET page to a 
browser you should do e.g.
   using (XmlReader xmlReader = sqlCommandInstance.ExecuteXmlReader())
   {
     Response.ContentType = "application/xml";
     using (XmlWriter xmlWriter = XmlWriter.Create(Response.Output))
     {
       xmlWriter.WriteNode(xmlReader, false);
     }
   }
That way the XML should be streamed from SQL Server to ASP.NET and from 
ASP.NET to the browser. Might need to turn off ASP.NET output buffering.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent