Why Large datatable in the case of crystal report is causing out of memory exception in IIS 7.5? I am using asp.net with c#. The datatable is having around 4 lakh records. But the max limit is around 1 crore something.
So how to resolve this issue.
Crystal Report code as follows:
if(Session["ROLE"].ToString()=="C3O")
{
ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3O");
}
else
{
ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3");
}
DataTable dt = new DataTable();
if (ds.Tables[0].Rows.Count > 0)
dt = ds.Tables[0];
else
{
Common.showMessage("No Records Found", this);
return;
}
reportDocument = new ReportDocument();
reportDocument.Load(reportPath);
reportDocument.SetDataSource(dt);
reportDocument.SetParameterValue("@p_FromMonth", startMonth);
reportDocument.SetParameterValue("@p_ToMonth", endMonth);
reportDocument.SetParameterValue("@p_FromYear", startYear);
reportDocument.SetParameterValue("@p_ToYear", endYear);
CRVActiveCardsDetails.ReportSource = reportDocument;
CRVActiveCardsDetails.DataBind();
Common.UserPageAudit(Session["User"].ToString(), "Active Cards Details", Session["ROLE"].ToString(), "Active Cards Details Report Viewed");