以下的文章主要向大家介绍的是MS SQL Server 连接字符串的实际操作,假如你对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
其中:
[Data Source]:别名(Server、Address、Addr),假如是本地数据库且定义了实例名,则可以写为"Server=(local)实例名";假如是远程服务器,则将"(local)"替换为远程服务器的名称或IP地址。
[Initial Catalog]:别名(Database)
[user id]:别名(uid)
[Password]:别名(pwd)
[Connect Timeout]:连接超时时间为30秒.
[Enlist] [Pooling] [Max Pool Size] [Min Pool Size] [Connection Lifetime] [packet size] [Integrated Security]
[Trusted_Connection]Windows登录,假如你的MS SQL Server设置为Windows登录,那么在这里就不需要使用"user id"和"password"这样的方式来登录,
而需要使用"Trusted_Connection=SSPI"来进行登录.
Integrated Security=SSPI与Trusted_Connection=SSPI的区别?
原文标题:MS SQL Server 连接字符串
连接:http://www.cnblogs.com/wangzb/archive/2010/03/03/1677035.html