System.OutOfMemoryException

来源:互联网 发布:淘宝发错货发了个贵的 编辑:程序博客网 时间:2024/05/16 18:22
处理报表时出错。引发类型为“System.OutOfMemoryException”的异常。  

在数据查询时一次性放入datatable 大概220000条,但绑定到数据时就出现以上错误!!

this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("../statistics/Template/") + ReportName + ".rdlc";
this.ReportViewer1.LocalReport.DataSources.Clear();
ReportDataSource rds = new ReportDataSource(ReportName, dt);
dt.Dispose();
this.ReportViewer1.LocalReport.DataSources.Add(rds);
this.ReportViewer1.LocalReport.Refresh();
this.ReportViewer1.Dispose();
 GC.Collect();
原创粉丝点击