Error when try exporting 33000 datarow

Jul 12, 2011 at 4:47 AM

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) +29
   System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength) +69
   System.Text.StringBuilder.Append(Char value) +98
   System.IO.StringWriter.Write(Char value) +31
   Antlr.StringTemplate.AutoIndentWriter.Write(String str) +90
   Antlr.StringTemplate.Language.StringRef.Write(StringTemplate self, IStringTemplateWriter output) +22
   Antlr.StringTemplate.StringTemplate.Write(IStringTemplateWriter output) +123
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +328
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +473
   Antlr.StringTemplate.Language.ASTExpr.WriteAttribute(StringTemplate self, Object o, IStringTemplateWriter output) +13
   Antlr.StringTemplate.Language.ActionEvaluator.action(AST _t) +118
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, IStringTemplateWriter output) +242
   Antlr.StringTemplate.StringTemplate.Write(IStringTemplateWriter output) +123
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +328
   Antlr.StringTemplate.Language.ASTExpr.WriteAttribute(StringTemplate self, Object o, IStringTemplateWriter output) +13
   Antlr.StringTemplate.Language.ActionEvaluator.action(AST _t) +118
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, IStringTemplateWriter output) +242
   Antlr.StringTemplate.StringTemplate.Write(IStringTemplateWriter output) +123
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +328
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +473
   Antlr.StringTemplate.Language.ASTExpr.WriteAttribute(StringTemplate self, Object o, IStringTemplateWriter output) +13
   Antlr.StringTemplate.Language.ActionEvaluator.action(AST _t) +118
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, IStringTemplateWriter output) +242
   Antlr.StringTemplate.StringTemplate.Write(IStringTemplateWriter output) +123
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +328
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, Object o, IStringTemplateWriter output) +473
   Antlr.StringTemplate.Language.ASTExpr.WriteAttribute(StringTemplate self, Object o, IStringTemplateWriter output) +13
   Antlr.StringTemplate.Language.ActionEvaluator.action(AST _t) +118
   Antlr.StringTemplate.Language.ASTExpr.Write(StringTemplate self, IStringTemplateWriter output) +242
   Antlr.StringTemplate.StringTemplate.Write(IStringTemplateWriter output) +123
   Antlr.StringTemplate.StringTemplate.ToString(Int32 lineWidth) +97
   Antlr.StringTemplate.StringTemplate.ToString() +13
   www.serviciipeweb.ro.iafblog.ExportDLL.CollectionRenderProperties.DataTable2String(DataTable dt, List`1 properties, ExportToFormat exp) +323
   www.serviciipeweb.ro.iafblog.ExportDLL.CollectionRenderProperties.ExportTo(DataTable dt, List`1 properties, ExportToFormat exp, String FileName) +51
   www.serviciipeweb.ro.iafblog.ExportDLL.CollectionRenderProperties.ExportTo(DataTable dt, ExportToFormat exp, String FileName) +62
   OngamePortal.Events.SlotMachine.Admin._Default.btnExport_Click(Object sender, EventArgs e) +173
   System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Coordinator
Jul 12, 2011 at 9:39 AM

too much data for your system...

Aug 5, 2011 at 4:43 AM
Edited Aug 5, 2011 at 4:45 AM

Ok, I fix problem, Error when I try export with type Excel 2007, so I export with type .csv, no error found! Except error font uncode in file .csv