MS SQL Server 連接字符串的實(shí)際操作簡介
以下的文章主要向大家介紹的是MS SQL Server 連接字符串的實(shí)際操作,如果你對MS SQL Server 連接字符串的實(shí)際操作流程有興趣了解的話,你就可以通過以下的文章對其有更深的了解。
字符串:
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),如果是本地?cái)?shù)據(jù)庫且定義了實(shí)例名,則可以寫為"Server=(local)\實(shí)例名";如果是遠(yuǎn)程服務(wù)器,則將"(local)"替換為遠(yuǎn)程服務(wù)器的名稱或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設(shè)置為Windows登錄,那么在這里就不需要使用"user id"和"password"這樣的方式來登錄,
而需要使用"Trusted_Connection=SSPI"來進(jìn)行登錄.
Integrated Security=SSPI與Trusted_Connection=SSPI的區(qū)別?
原文標(biāo)題:MS SQL Server 連接字符串
連接:http://www.cnblogs.com/wangzb/archive/2010/03/03/1677035.html
【編輯推薦】