我知道我的問題是基本的。 但我不知道如何配置web.config
信息!連接到ASP中的SQL服務器數據庫
我的SQL服務器與Windows身份驗證連接。 我使用這個配置:
<add key="DBServer" value="mssql" />
<add key="DBSource" value="localhost" />
<add key="DBName" value="TestDB" />
<add key="LoginName" value="KARIM-PC\Karim" />
<add key="LoginPWD" value="" />
,但我得到這個錯誤:
{"This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection."}
Exception: Thrown: "Login failed for user 'KARIM-PC\Karim'." (System.Data.SqlClient.SqlException) A System.Data.SqlClient.SqlException was thrown: "Login failed for user 'KARIM-PC\Karim'."
謝謝。我有這個錯誤:'{「值不能爲空。\ r \ n參數名稱:用戶ID」}' –
在web配置中添加了「用戶ID」的位置? –
'web.config'在這裏:[鏈接](https://github.com/wells-z/CPCMVCMSSQL/blob/master/CoolPrivilegeControl/Web.config) –