Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
SQL
I have Grid View which need to assign over 17 Million of records  and all the records need to export as CSV file. I am using Oracle as back end. When I am retrieve the data oracle is working fine. Problem starts when I pull the data in to .net .

    When I load the data into data table when I am getting below error.

Error Message:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Smart.BOBReportDB.getBOBResult(String strPolicy, String strActive, String strNetworkOffice, String strAgents, String strSSN, String strLOB, String strProduct, String strReportNo, String strClientName, String strOrphanPolicy, String strAuthAgency, String strRoleKey, String strEntity_ID_NO) at Smart.BOBReport.btnSearch_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Posted
Comments
Thanks7872 26-Sep-13 8:36am    
Grid View?17 Million of records? Are you ok?

Uhmm .. you don't have enough physical memory to do whatever it is you want the program to do.
There are a few things you can do :

* Chop the data up in bits, before you're importing it in .NET.
* Create sub queries in order to get smaller pieces of data.
* Increase the physical memory in your hardware.

You might have to go back to the drawing board and re-design your program's architecture. Apparently your program is struggling with the amount of data it has to swallow at once.
 
Share this answer
 
v2
Since anyway no human could ever see all the 17 million records of the GridView, why don't you load (and handle) the records in smaller chunks?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900