2013-04-09 90 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