Solved page freezes after gridview populates

Posted on 2011-10-12
Last Modified: 2012-05-12
Hello experts,
I have some code attached that does some serious database crunching and returns about 18,000 rows into a datareader which gets bound to a gridview. That parts seems to be working ok but the page freezes and I can't do the last function, which is export to excel. I realize this page is not the best designed, but I sure could use some help. The debugger is not telling me anything useful. When I run the sql code straight through the database it takes a few minutes to run, which is about the same as the web page. And when I run smaller data sets, it works fine. Thanks.
Question by:dpicco
    LVL 3

    Expert Comment


    I did not yet look at your code, but this might be more of a browser-problem, than an application-server based one.
    18.000 rows seems a lot to me. Ever thought about paging? Could you try to page the data? Does that help?
    In one of our applications I discovered that the Skype AddIn in conjunction with IE heavily influences performance of page-rendering an the client.
    Are you using IE? If yo, do you have the Skype-Addin installed? If so, try to deactivate it.

    Hope this helps you out, let me know your results,

    LVL 11

    Accepted Solution

    There is too much data and the system can't handle it. Just do a quick test, export to excel directly from database all the record and check the excel size. Then imagine that you have to move that data from database to web server then to client and then the client to open it.

    When I did this for my data I found out that I need hours for the operations and that it's normal for the browser to freeze.

    One solution would be to do data filtering and allow displaying and exporting of only small/filtered chunks of data.
    The other is to  redesign your application:
    - for displaying do some real gridview paging using ObjectDataSource

    - for exporting to excel: save it hourly/daily with a server job and redirect the user to export the pre-saved excel
    LVL 3

    Author Closing Comment

    Thanks. I will be running this detailed query directly from the database and not sending it through the web server.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now