超时已过期。操作完成之前经过的超时时间或服务器没有响应。在服务器DB [英] Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at Server DB

查看:83
本文介绍了超时已过期。操作完成之前经过的超时时间或服务器没有响应。在服务器DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Data.SqlClient.SqlException:超时已过期。操作完成之前经过的超时时间或服务器没有响应。

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

推荐答案

尝试增加

SqlCommand.CommandTimeout

- 值为0表示无限制

- 默认为30秒

SqlConnection.ConnectionTimeout

- 值为0表示没有限制,应该在ConnectionString中避免,因为尝试连接将无限期等待

- 默认值为15秒



希望,它有帮助:)



参考:

SqlCommand.CommandTimeout Property [ ^ ]

SqlConnection.ConnectionTimeout属性 [ ^ ]
Try increasing
SqlCommand.CommandTimeout
- a value of 0 indicates no limit
- default is 30 seconds
SqlConnection.ConnectionTimeout
- a value of 0 indicates no limit, and should be avoided in a ConnectionString because an attempt to connect will wait indefinitely
- default value is 15 seconds

Hope, it helps :)

Reference:
SqlCommand.CommandTimeout Property [^]
SqlConnection.ConnectionTimeout Property[^]


这篇关于超时已过期。操作完成之前经过的超时时间或服务器没有响应。在服务器DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆