Heim  >  Artikel  >  Datenbank  >  sqlServer 数据库常用连接字符串

sqlServer 数据库常用连接字符串

WBOY
WBOYOriginal
2016-06-07 15:39:563009Durchsuche

sqlServer 数据库常用连接字符串 用户名和密码验证的方式去连接到数据库服务器 add name="conStr" connectionString="Data Source=服务器名;Initial Catalog=数据库名; User Id=用户名;Password=密码"/ add name="conStr" connectionString="Server=服务器名

sqlServer   数据库常用连接字符串

用户名和密码验证的方式去连接到数据库服务器

   

    

 

Windows验证的方式去连接到数据库服务器

 

  

       

  

 

 

常用的属性:

服务器

Data Source

Server

数据库

Initial Catalog

database

用户名

User Id

uid

密码

Password

pwd

启用连接池

pooling=true(默认值)

最小连接数量

min pool size=1;

最大连接数量

max pool size=2

重置连接池

connection reset=true

身份验证方式

Integrated Security 
当为false时,将在连接中指定用户ID和密码。
当为true时,将使用当前的Windows帐户凭据进行身份验证。
可识别的值为true、false、yes、no以及与true等效的sspi。

信任连接

1)web.config中Trusted_Connection=true改为Trusted_Connection=false可以消除如下错误:
"用户
'NT AUTHORITY\NETWORK SERVICE' 登录失败。"
(2)Trusted_Connection

当为 false 时,将在连接中指定用户 ID 和密码。当为 true 时,将使用当前的 Windows 帐户凭据进行身份验证。 
可识别的值为 true、false、yes、no 以及与 true 等效的 sspi(强烈推荐)。

(3)当在WEB.CONFIG使用Trusted_Connection=true时,SERVER DATABASE已设置为用信任连接了.

加密

Encrypt = yes

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn