首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

水晶表格-Exception of type 'System.OutOfMemoryException' was thrown

2012-12-14 
水晶报表---Exception of type 'System.OutOfMemoryException' was thrown.Server Error in /

水晶报表---Exception of type 'System.OutOfMemoryException' was thrown.
Server Error in '/' Application.
--------------------------------------------

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: 


Line 190:            sql = "select DATE,PanelID,protypeID,panelsizeid,stepid,paneltypeid from n_p_Stepmove where 0=0 " + strsql;
Line 191:            sda = new SqlDataAdapter(sql, cn);
Line 192:            sda.Fill(ds, "n_p_Stepmove");
Line 193:
Line 194:            cn.Close();
 

Source File: e:\WEB\epqc2\front\RS_stepmove_panel.aspx.cs    Line: 192 

Stack Trace: 


[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding) +67
   System.Text.EncodingNLS.GetString(Byte[] bytes, Int32 index, Int32 count) +112
   System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp) +105
   System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj) +123
   System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj) +174
   System.Data.SqlClient.SqlDataReader.ReadColumnData() +88
   System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout) +223
   System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i) +17
   System.Data.SqlClient.SqlDataReader.GetValues(Object[] values) +181
   System.Data.ProviderBase.CommonLanguageSubsetDataReader.GetValues(Object[] values) +10
   System.Data.ProviderBase.SchemaMapping.LoadDataRow() +30
   System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +137
   System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +153
   System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +170
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +175


   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   front_RS_stepmove_panel.Page_Init(Object sender, EventArgs e) in e:\WEB\epqc2\front\RS_stepmove_panel.aspx.cs:192
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Page.OnInit(EventArgs e) +9
   System.Web.UI.Control.InitRecursive(Control namingContainer) +321
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834

 
经常会有这样的问题存在,纠结中。。。。。。。。。
[最优解释]
OutOfMemoryException
内存溢出了,是不是你的数据量太大了
[其他解释]
如1楼所说,在报错的时候,检查下你的SQL语句返回的数据集的数据条数看看。

[其他解释]
在设计报表的时候,我用的是子报表。。。。用的原因也是为了解决数据量太大。结果成功显示了,在后台cs文件里面,我的代码
SqlConnection cn = CommonClass.getConnection();
            cn.Open();
            DataSet ds = new DataSet();
            string sql;
            sql = "select ID,SIZE from B_Size where isdel=0";
            SqlDataAdapter da = new SqlDataAdapter(sql, cn);
            da.Fill(ds, "B_Size");

            sql = "select ID,Tool from B_Tool where isdel=0";
            da = new SqlDataAdapter(sql, cn);
            da.Fill(ds, "B_Tool");


            sql = "select ID, ProType from B_ProductionType where ISDEL=0";
            da = new SqlDataAdapter(sql, cn);
            da.Fill(ds, "B_ProductionType");


            sql = "select ID, step from B_Step where ISDEL=0 order by orderid ";
            da = new SqlDataAdapter(sql, cn);
            da.Fill(ds, "B_Step");

            sql = "select ID, PanelType from B_PanelType where ISDEL=0";
            da = new SqlDataAdapter(sql, cn);


            da.Fill(ds, "B_PanelType");

            sql = "select ID,panelid,protypeid,paneltypeid,stepid,offlinetime,panelsizeid,toolid,processingtime,redo,scrap,startloadtime,trackintime,trackouttime,warningtime from D_RunTracking  where convert(varchar(10),trackouttime-8.5/24,120)='"+DTdate+"'";
            da = new SqlDataAdapter(sql, cn);
            da.Fill(ds, "D_RunTracking");


          

            ReportDocument report = new ReportDocument();
            string reportPath = Server.MapPath("J_RunTracking.rpt");
            report.Load(reportPath);
            report.SetDataSource(ds);
            CrystalReportViewer1.ReportSource = report;
            CrystalReportViewer1.DataBind();
            tag = "first";
            cn.Close();

它并不是一开始就有这个错误,有时候有有时候没有,ds里面有多张表,他们在后台不是也是笛卡尔积相乘吧,那怎么办呢????
[其他解释]
还要回复才能看啊

热点排行