Timeout expired

C

Chakravarti Mukesh

Hi all,
I have put some queries on the page that takes too much time to execute.
Thus at the time of peak load it gives the following error.
Server Error in '/ge' Application.
--------------------------------------------------------------------------------

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period elapsed prior to completion of the operation or the server is
not responding.

I want it to execute to completion even it takes any amount of time. What
should I do? I got similar TimeOut Exception in VB also. Is it a SQL
Server related issue?

Thanks
Chakravarti Mukesh
 
R

Rick Strahl [MVP]

SQL Server has to be configured for a specific command timeout. You can
configure that as part of your command object that you write to access SQL
Server. The SqlCommand object has a CommandTimeout property you can set to
make this longer...

In addition ASP.NET also has a Request Timeout that you can set in
web.config
<system.web>
<httpRuntime executionTimeout="180"/>
</system.web>

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
M

Mark Micallef

If the information returned by the query does not need to be absolutely
up to date, you might also consider an asynchoronous process. I do this
a lot to compile metrics for a number of call centre clients. It's way
too taxing to have it done in real time, so instead we have a reporting
process that kicks off every 15 minutes and updates the statistics by
analysing metrics in the database. When the user goes to the stats
screen, it just fetches the stats from the database. In this way, the
user doesn't have the wait, and the stats are at most a few minutes old.
You need to decide if this will work for you.

Your asynchronous process can be in any technology you like, so long as
it can access the database. I would suggest a COM+ component for
efficiency, though a .Net batch process will do the task just fine. You
can use SQL Server Agent or Task Manager to fire it off at the required
intervals. It should have some way to check that another instance is not
running when it starts (if there is, it should just exit).

Hope this helps.

Regards,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top