【发布时间】:2013-04-09 12:01:57
【问题描述】:
我有一个 asp.net 网站,它是在 asp.net 4.0 中开发的,具有来自数据库的数据绑定,该数据库在 sql server 2000 中维护。 它在 localhost 上运行良好,但是当我在 IIS 上部署它并运行页面时出现以下错误。
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"))
【问题讨论】:
-
看来问题出在其他地方,您提供的连接字符串中没有使用
sa用户。 -
检查您的 sa 用户是否已启用并能够连接到连接字符串中的数据库
-
@alex..实际上它的“testuser”不是“sa”..打字错误......现在有什么帮助吗?
-
与兼容性(版本)问题有关吗??