【问题标题】:Default Timeout Period in SQL ServerSQL Server 中的默认超时期限
【发布时间】:2019-07-02 08:53:08
【问题描述】:

我收到了错误

超时。在操作完成之前超时时间已过或服务器没有响应。

在命令执行期间。

我还在连接字符串中设置了Connect Timeout=60

那个存储过程的执行时间大约是 35 秒。

连接建立,但没有返回结果。

【问题讨论】:

标签: c# sql-server


【解决方案1】:

DbCommandCommandTimeout,这就是你想要的——它是根据命令设置的; “连接超时”仅会合理地影响用于连接的超时时间。 SqlCommandCommandTimeout 的默认值为 30 秒。

【讨论】:

    【解决方案2】:

    你也可以在连接字符串中延长连接超时时间

    ;连接超时=30

    见:Connection timeout for SQL server

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-02
      • 1970-01-01
      • 1970-01-01
      • 2019-01-27
      • 2022-08-15
      • 1970-01-01
      • 2011-11-18
      • 2014-10-24
      相关资源
      最近更新 更多