急求,用户 'sa' 登录失败,怎么解决啊?

kellywenfeng 2013-06-22 06:19:42
Server Error in '/' Application.
用户 'sa' 登录失败。
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.SqlClient.SqlException: 用户 'sa' 登录失败。

Source Error:

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.

Stack Trace:


[SqlException (0x80131904): 用户 'sa' 登录失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +52

[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +161
System.Data.EntityClient.EntityConnection.Open() +98
System.Data.Objects.ObjectContext.EnsureConnection() +81
System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +46
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +38
System.Linq.Enumerable.Single(IEnumerable`1 source) +108
System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__3(IEnumerable`1 sequence) +4
System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +24
System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +87
System.Linq.Queryable.Count(IQueryable`1 source) +243
WebUi.Account.Login.LoginButton_Click(Object sender, ImageClickEventArgs e) in D:\WebUi\Account\Login.aspx.cs:39
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563


...全文
7698 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
afu45 2013-06-27
  • 打赏
  • 举报
回复
引用 17 楼 HHQSY 的回复:
[quote=引用 16 楼 heli_1005 的回复:] [quote=引用 1 楼 bdmh 的回复:] 很可能是没有放开sa登录权限,默认是不允许sa登陆,网上搜
++[/quote]++[/quote] +++
  • 打赏
  • 举报
回复
引用 16 楼 heli_1005 的回复:
[quote=引用 1 楼 bdmh 的回复:] 很可能是没有放开sa登录权限,默认是不允许sa登陆,网上搜
++[/quote]++
heli_1005 2013-06-27
  • 打赏
  • 举报
回复
引用 1 楼 bdmh 的回复:
很可能是没有放开sa登录权限,默认是不允许sa登陆,网上搜
++
JiangBo 2013-06-27
  • 打赏
  • 举报
回复
连接数据库的字符串和数据库登录的身份不合,你试着用Windows身份模式登录SQL Ssever!!!
ycproc 2013-06-27
  • 打赏
  • 举报
回复
先使用window 登录 修改 sa的密码,然后密码策略。
吴青峰 2013-06-27
  • 打赏
  • 举报
回复
一般这种情况都是链接字符串写得不对的原因!
吴青峰 2013-06-27
  • 打赏
  • 举报
回复
是不是你链接字符串写得不对!
kellywenfeng 2013-06-27
  • 打赏
  • 举报
回复
我都试过了,怎么还是不行啊!在此之前发布网站,能够正常访问数据库,但是重新发布新网站,就不行了。求解啊
kellywenfeng 2013-06-27
  • 打赏
  • 举报
回复
哎,感谢上面各位的回答,问题还是没解决啊!郁闷。。。。。
joyhen 2013-06-24
  • 打赏
  • 举报
回复
服务是否开启,端口可对,sa权限有吗,
令狐苦瓜 2013-06-24
  • 打赏
  • 举报
回复
密码对不,用数据库客户端登陆试试
F15Eagle 2013-06-24
  • 打赏
  • 举报
回复
使用混合模式,设置一个sa密码。
紫魂一号 2013-06-24
  • 打赏
  • 举报
回复
这问题多种情况导致的。你的前提是什么??
-烟花雨季 2013-06-24
  • 打赏
  • 举报
回复
启动sql服务
吴青峰 2013-06-24
  • 打赏
  • 举报
回复
请使用sql server身份验证登录,链接字符串,如: Data Source=.;Initial Catalog=你的数据库名;Persist Security Info=True;User ID=sa;Password=123 用户名和密码修改为你自己的。
litengfei0020 2013-06-24
  • 打赏
  • 举报
回复
引用 2 楼 Return_false 的回复:
打开数据库,直接用混合模式验证,以sa登陆,看是否成功
+1
  • 打赏
  • 举报
回复
打开数据库,直接用混合模式验证,以sa登陆,看是否成功
bdmh 2013-06-22
  • 打赏
  • 举报
回复
很可能是没有放开sa登录权限,默认是不允许sa登陆,网上搜

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧