连接超时值应该是什么? [英] What should the value of Connection Timeout?

查看:866
本文介绍了连接超时值应该是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

连接超时"的值应该是什么?

What should the value of Connection Timeout?

"Data Source=server ;Initial Catalog=AdventureWorks;"
        + "Integrated Security=SSPI;Connection Timeout=30";


这是我的连接字符串.
我的数据库在Lan上的另一台计算机上.


This is my connection string.
My database is on other machine in Lan.

推荐答案

即使在非常慢的网络上,默认的15秒通常也足够.如果使用设置的30,请继续使用.增加此值的唯一缺点是,如果连接尝试失败,则必须等待整个超时长度才能看到错误.
Even on a very slow network, the default 15 seconds is usually plenty. If you use the 30 that you have set, go for it. The only downside to increasing this value is that you have to wait that full timeout length to see an error if the connection attempt fails.


连接超时
获取在尝试建立连接之前要等待的时间,然后再终止尝试并生成错误.
您可以根据需要编写它.
您可以参考
http://msdn.microsoft.com /en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.71).aspx [
Connection Time Out
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
You can Write that as You want.
You can Refer
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.71).aspx[^]


这篇关于连接超时值应该是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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