System.OutOfMemoryException while exporting to CSV

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amollokhande1
    New Member
    • Feb 2008
    • 33

    System.OutOfMemoryException while exporting to CSV

    Hi All,

    I am facing an issue while exporting the data of 40k+ to CSV. Here is the implementation detail
    1. Fetch the data from database
    2. Create the comma seperated list and store that into string variable
    3. Once the entire data is converted into comma seperated list write that string variable with data in it (comma seperated list) back to the browser using Reponse.write


    Above functionality works well if I export small amount of data. But when I tries to export the huge data say around 40 to 50 thousand records, system is generating the error as "System.OutOfMem oryException"

    To resolve this issue, I tried to use string builder but even after that issue still remains as it is. Can anybody let me know the solution for this? How to tackle such issues?

    Regards
    Amol Lokhande
Working...