0
votes

I'm trying to execute a sql server query through asp.net but the following exception occurs : "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

My connection string timeout is 300000 and remote query timeout in sql server is 60000 how can i solve this problem

3
Could you provide some details: how do you connect, where SQL server is located, how to you get this error: after the timeout or when you starting the query? - Vladislav Rudskoy

3 Answers

0
votes

I seems you have a blocked table. You can exec sp_lock to see who is blocking what.

If there is no blocking, then you have a query really bad constructed.

0
votes

Please extend the script execution timeout in web.config file.

<!-- Increase script execution timeout  -->
<system.web>
    <httpRuntime executionTimeout="300" /> <!-- its 5 min -->
</system.web>

Hope, this will resolve your issue.

Thanks, Rohit

0
votes

The problem is with the command timeout, i solved the problem with the following line of code :

command.CommandTimeout = 30000;

but the question now : how can i set commandTimeout default value over the application