這裏從外面.NET項目測試SQL Server連接的Windows身份驗證是cenario:如何測試域
我有一個名爲測試在Active Directory中創建一個帳戶。
此帳戶有權限讀取數據庫的實例。
我可以使用Windows身份驗證通過SQL Server Visual Management Studio訪問域>內的數據。
現在的問題:
我怎樣才能外面>域名,將與.NET項目測試訪問這些數據?
我把這個在我的app.config:
<connectionStrings>
<add name="CRM" connectionString="Data Source=server; Initial Catalog=catalog; Integrated Security=SSPI; providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<identity impersonate="true" userName="domain\user" password="pass"/>
</system.web>
但我仍然收到此錯誤:
Login failed for user 'x'. The user is not associated with a trusted SQL Server connection.
最後,而不是最不重要的,是的,我確實有SQL和窗口認證模式啓用。
不'數據源= 212.22.231.11,1433'? – zimdanen
@zimdanen我仍然繼續收到**用戶登錄失敗。用戶未與可信的SQL Server連接相關聯。** –
您是否刪除了impersonate標記,並且還告訴我您是SQL Server用戶名/密碼身份驗證(如果不創建用戶並使用該用戶與SQL Server管理工作室連接)。如果您成功登錄使用該用戶名傳遞連接字符串,請參閱http://www.connectionstrings.com/sql-server-2005另請參閱http://www.dreamincode.net/forums/topic/155164-connecting-to-a -remote-sql-server-via-internet-ip-address /和搜索sql服務器錯誤代碼 – Adil