Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3339044
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:26:49+00:00 2026-05-18T00:26:49+00:00

I am seeking your advice with regards to generating CSV reports. I have an

  • 0

I am seeking your advice with regards to generating CSV reports.

I have an ASP.NET application that is produces reports on billing data. Recently, I have noticed that when it tries to export a report file the web application is unresponsive and will throw in an OutOfMemory exception or Server timeout exception.

What I did to amend this was to:

  • Place the necessary indexes in SQL server to get the records faster
  • Use SqlDataReader to fetch the data from SQL server
  • Specify the criteria needed to pull out necessary records instead of getting all information in one call.

I have also thought of limiting the maximum number of records returned from the database but the system needs to produce all information regardless of how big the rowcount is returned because the information being downloaded will be critical for our client’s financial records.

I am wondering, what methods/solutions that can be used to render CSV reports that have huge data in ASP.NET?

Looking forward for your response.

Cheers,
Ann

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:26:49+00:00Added an answer on May 18, 2026 at 12:26 am

    To solve the server timeout exception I would try to produce the reports asynchronously. So when your application receives a request to generate a report it should launch another thread that does the generation and return the request immediately.

    You’ll then need another page that lets visitors pick up reports after they’ve been generated.

    This all involves a bit more work within the application of course, to record what reports are being generated, and mark them as generated when complete.

    As for the out of memory exception – that is specific to the way you are generating the reports. It’s very rare to get out of memory exceptions unless you really are doing something quite crazy – so are you somehow consuming lots of memory in your CSV generation – creating lots and lots of string objects for example? Make sure you’re using StringBuilder, or better still perhaps stream the output directly into a file.

    Final tip – if you are serving huge files like this make sure you have GZIP or DEFLATE compression enabled for these file types on your IIS configuration. That will significantly reduce the size of the package to be delivered to the client – but at the cost of some processing time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here I am again seeking your advice and guidance. Say I have a a
I'm seeking graphic advice on how to have your interface look better. So far
Here's the problem: your program temporarily uses some sensitive data and wants to erase
Removed the C tag, seeing as that was causing some confusion (it shouldn't have
i want your help very badly..bcz i am seeking an answer for this from
aka, Seeking generic Error Handler (ΟΚ to use commercially) I doubt that I am
I have looked and searched for an answer for that question and I found
I am not familiar with this website but I am desperately seeking help with
Seeing as Java doesn't have nullable types, nor does it have a TryParse(), how
After seeing a previous post Making Applications programmed in .NET languages work on older

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.