page freezes after gridview populates

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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,

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dpiccoAuthor Commented:
Thanks. I will be running this detailed query directly from the database and not sending it through the web server.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.