以前對於我們所有的asp.net應用程序,我們一直使用SQL Server中的sysadmin用戶來連接和添加/更新/刪除/獲取數據。我們的SQL管理員想要刪除該帳戶並創建一個域帳戶,以便我們可以在我們的.net應用程序中使用該帳戶。使用域用戶的連接字符串?
我現在的連接字符串是:
name="name" connectionString="Data Source=server;Initial Catalog=database;Persist Security Info=True;User ID=user;Password=password" providerName="System.Data.SqlClient"
將連接字符串是什麼使用域帳戶?
我想:
name="name" connectionString="Data Source=server;Initial Catalog=database;Persist Security Info=True;User ID=domain\user;Password=password" providerName="System.Data.SqlClient"
,它不工作。
是否有不同的方式使用域帳戶連接到SQL Server?
感謝您的幫助。
**注**:您無法連接字符串登錄到SQL Server中的傳遞Windows用戶名和密碼,詳見[這裏](https://開頭stackoverflow.com/questions/830929/database-windows-authentication-username-password)。它必須是SQL用戶登錄名。 – RBT 2017-06-30 07:24:13