C#访问SqlServer设置链接超时,这段代码设置超时时间为60秒,默认为30秒
using (connection) { SqlCommand sqlcommand = connection.CreateCommand(); sqlcommand.CommandTimeout = 60; //default is 30 seconds sqlcommand.CommandText = sqlText; ...
C#访问SqlServer设置链接超时,这段代码设置超时时间为60秒,默认为30秒
using (connection) { SqlCommand sqlcommand = connection.CreateCommand(); sqlcommand.CommandTimeout = 60; //default is 30 seconds sqlcommand.CommandText = sqlText; ...