標籤:
用.udl串連資料庫時,選擇允許儲存密碼時Persist Security Info=True,否則為False
Persist Security Info屬性的意思是表示是否儲存安全資訊,其實可以簡單的理解為"ADO在資料庫連接成功後是否儲存密碼資訊",
True表示儲存,False表示不儲存
ADO.net預設為False,未測試,根據參考資料上說的
具體可以通過ADO的Connect對象的ConnectString屬性進行驗證,如下所示
----------------------------------------------------------------------------------------------------------
資料庫連接前
ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=yzs;Data Source=ydgl22;Persist Security Info=false"
資料庫連接成功後
ConnectString="Provider=MSDAORA.1;User ID=yzs;Data Source=ydgl22"
----------------------------------------------------------------------------------------------------------
資料庫連接前
ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=yzs;Data Source=ydgl22;Persist Security Info=true"
資料庫連接成功後
ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=dlyx;Data Source=ydgl22"
sql資料庫連接字串(Persist Security Info)