2013-04-09 117 views
0

我這是在asp.net 4.0開發了數據從數據庫是保持在SQL Server 2000結合一個asp.net網站.. 它,它在本地主機工作正常,但當我在IIS上部署它並在運行頁面時出現以下錯誤。錯誤運行在IIS上發佈的網站,而7.5

Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code

Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.

源錯誤:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

  • 我使用混合模式身份驗證和SQL Server 2008安裝 我的系統
  • 我使用下面的連接字符串我的.cs 頁

using (OleDbConnection con3 = new OleDbConnection("Provider=SQLOLEDB;Data Source=sbs;User ID=testuser;Passwrd=pinkCITY01;Initial Catalog=PCGnet"))

+1

看來這個問題是在其他地方,在'sa'用戶不在您提供的連接字符串中使用。 – 2013-04-09 12:12:28

+0

http://support.microsoft.com/kb/889615和http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/a1a371f8-7ed2-47f8-b155-a553d47fb6e9/ – Kashif 2013-04-09 12:14:06

+0

檢查看看你的sa用戶的連接字符串 – davidb 2013-04-09 12:19:39

回答

0

嘗試添加集成安全性= SSPI到連接字符串

,或參閱以下鏈接

Login Failed 'sa'

+0

我用集成提供給「testuser的」所有的權限和角色davidb..yup安全= SSPI ..但沒有愛..現在顯示..登錄失敗的用戶'(空)'。原因:不與可信的SQL Server連接關聯 – Rajeev 2013-04-09 12:26:48