MS SQL Server 连接字符串
字符串:1、Data Source=.;uid=sa;pwd=wzb0227;Integrated Security=SSPI;Initial Catalog=Evaluation;Integrated Security=True
2、Data Source=(local);Initial Catalog=BarefootIndex0425;User Id=sa;Password=sa;Connect Timeout=180;Enlist=true;Pooling=true;Max Pool Size = 300;Min Pool Size = 5;Connection Lifetime=200;packet size=4096
其中:
:别名(Server、Address、Addr),如果是本地数据库且定义了实例名,则可以写为"Server=(local)\实例名";如果是远程服务器,则将"(local)"替换为远程服务器的名称或IP地址。
:别名(Database)
:别名(uid)
:别名(pwd)
:连接超时时间为30秒.
??
Windows登录,如果你的SQL Server设置为Windows登录,那么在这里就不需要使用"user id"和"password"这样的方式来登录,
而需要使用"Trusted_Connection=SSPI"来进行登录.
Integrated Security=SSPI与Trusted_Connection=SSPI的区别?
页:
[1]