从VB.net超时错误调用存储过程

Jim*_*Jim 4 sql vb.net stored-procedures timeout

从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.`
Run Code Online (Sandbox Code Playgroud)

SQL事件探查器说,当程序超时时,脚本会在30秒内运行并结束.

该脚本在SQL Server中自行运行大约1分45秒.

Cod*_*uth 5

执行SQL的超时值不存储在连接字符串中,它存储在SqlCommandas中SqlCommand.CommandTimeout.

默认值为30秒.