国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

sqlServer 數據庫常用連接字符串

2024-07-21 02:50:50
字體:
來源:轉載
供稿:網友
sqlServer 數據庫常用連接字符串

sqlServer 數據庫常用連接字符串

用戶名和密碼驗證的方式去連接到數據庫服務器

<add name="conStr" connectionString="Data Source=服務器名;Initial Catalog=數據庫名; User Id=用戶名;PassWord=密碼"/>

<add name="conStr" connectionString="Server=服務器名;Database=數據庫名;User Id=用戶名;Password=密碼"/>

<add name="conStr" connectionString="server=l服務器名;database=數據庫名;uid=用戶名;pwd=密碼;pooling=true;min pool size=1;max pool size=2;connection reset=true"/>

Windows驗證的方式去連接到數據庫服務器

<add name="conStr" connectionString="Data Source=服務器名;Initial Catalog=數據庫名;Integrated Security=True;" />

<add name="conStr" connectionString="Data Source=服務器名;Initial Catalog=數據庫名;Integrated Security=SSPI;" />

<add name="conStr" connectionString="Data Source=服務器名;Initial Catalog=數據庫名;Trusted_Connection = False;Encrypt = yes" />

<add name="conStr" connectionString=" data source=服務器名;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>

常用的屬性:

服務器

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帳戶憑據進行身份驗證??勺R別的值為true、false、yes、no以及與true等效的sspi(強烈推薦)。 (3)當在WEB.CONFIG使用Trusted_Connection=true時,SERVERDATABASE已設置為用信任連接了.

加密

Encrypt = yes


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石柱| 香港| 辛集市| 长垣县| 永登县| 闽侯县| 五莲县| 安塞县| 余江县| 米泉市| 大宁县| 巴里| 峨边| 会同县| 广昌县| 灵石县| 明星| 宁德市| 迭部县| 吉林省| 广德县| 响水县| 金阳县| 锦屏县| 洛川县| 潼关县| 富蕴县| 伊川县| 嘉荫县| 芒康县| 巨鹿县| 昔阳县| 肇源县| 杨浦区| 岑溪市| 边坝县| 太原市| 沙坪坝区| 元江| 武定县| 武强县|