Timeout expired error in ASP.NET but not on SQL Server Studio

In my ASP.NET application, I am getting the following error:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

But I can successfully connect to the database server using 'SQL Server Mangement Studio' and I can also correctly PING the host where SQL Server is hosted.

What can be wrong here.


Check your connection string in web.config. The connection string you are using via SQL Management Studio is different to the one in the web.config.


You can increase timeout in web.config too which is better or say best approach.

Also whenever you get this type of error and everything is good in confirable, then first debug the code,

  • if the issue code side, then you manage simply by changing logic.

  • If it is sqlserver side, then get the parameter value and sp or query. Run in to SSMS which gives you better idea.


  • Increasing Command timeout to 120 fixed my problem for me.

    adapter.SelectCommandCommandTimeout=120;

    链接地址: http://www.djcxy.com/p/56682.html

    上一篇: SQL 2005超时过期`

    下一篇: 在ASP.NET中超时过期错误,但不在SQL Server Studio上