从 vb.net 调用存储过程时,如果连接字符串中未指定超时,是否有默认的 SQL 超时时间?
我不确定是否有 CommandTimeout
在连接字符串中指定,但我正在经历所有的可能性。
例如,如果在 30 秒(或更长时间)后没有结果抛出:
`System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.`
SQL Profiler 说脚本会在程序超时时运行并在 30 秒内结束。
该脚本在 SQL Server 中自行运行约 1 分 45 秒,没有错误。
最佳答案
执行 SQL 的超时值不存储在连接字符串中,它存储在 SqlCommand
中。如 SqlCommand.CommandTimeout
.
默认值为 30 秒。
关于sql - 从VB.net调用存储过程超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2699676/