用户 'sa' 登录失败。说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 用户 'sa' 登录失败。源错误:
行 36: {
行 37: Utilities.LogError(ex);
行 38: throw ex;
行 39:
行 40: }源文件: c:\DIY\App_Code\GenericDataAccess.cs 行: 38 堆栈跟踪:
[SqlException (0x80131904): 用户 'sa' 登录失败。]
GenericDataAccess.ExecteSelectCommand(DbCommand command) in c:\DIY\App_Code\GenericDataAccess.cs:38
Link.GetLink() in c:\DIY\App_Code\Link.cs:148
Control_link.BindToLink() in c:\DIY\Control\link.ascx.cs:20
Control_link.Page_Load(Object sender, EventArgs e) in c:\DIY\Control\link.ascx.cs:16
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +46
System.Web.UI.Control.OnLoad(EventArgs e) +83
System.Web.UI.Control.LoadRecursive() +120
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
行 36: {
行 37: Utilities.LogError(ex);
行 38: throw ex;
行 39:
行 40: }源文件: c:\DIY\App_Code\GenericDataAccess.cs 行: 38 堆栈跟踪:
[SqlException (0x80131904): 用户 'sa' 登录失败。]
GenericDataAccess.ExecteSelectCommand(DbCommand command) in c:\DIY\App_Code\GenericDataAccess.cs:38
Link.GetLink() in c:\DIY\App_Code\Link.cs:148
Control_link.BindToLink() in c:\DIY\Control\link.ascx.cs:20
Control_link.Page_Load(Object sender, EventArgs e) in c:\DIY\Control\link.ascx.cs:16
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +46
System.Web.UI.Control.OnLoad(EventArgs e) +83
System.Web.UI.Control.LoadRecursive() +120
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
修改方法:
假设你代码里用的登录密码是sa,而数据库用的是空密码,打开SQL数据库,找到“安全性”,“登录”,右边窗体应该可以看到sa用户,双击该用户,弹出的对话框中,将密码删除,数据库选择你要连接的那个数据库,再弹出的重复输入密码框,也把新密码里的内容删除,确定就可以了。
如果数据库用的其他密码,比如“123”,也是按上面的步骤,设置新密码为你的“123”就可以了。