How to increase time in web.config for executing sql query

前端 未结 5 1869
故里飘歌
故里飘歌 2020-12-31 10:56

When I am running a query in web application, I\'m getting a null value. Same query directly in SQL Management Studio returns results.

I think that the

5条回答
  •  佛祖请我去吃肉
    2020-12-31 11:32

    SQL Server has no setting to control query timeout in the connection string, and as far as I know this is the same for other major databases. But, this doesn't look like the problem you're seeing: I'd expect to see an exception raised

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

    if there genuinely was a timeout executing the query.

    If this does turn out to be a problem, you can change the default timeout for a SQL Server database as a property of the database itself; use SQL Server Manager for this.

    Be sure that the query is exactly the same from your Web application as the one you're running directly. Use a profiler to verify this.

提交回复
热议问题