C# 登录操作间歇性失败

C# 登录操作间歇性失败,c#,asp.net,C#,Asp.net,我已经忍受了这个错误一段时间,但它已经达到了它的接受极限。我有一个“很好”的登录控件。很好,这意味着它通常能够成功地进行身份验证,但在其他时候,我尝试登录,就好像撞到了一堵看不见的墙。 “/”应用程序中的服务器错误。 无法打开用户默认数据库。登录失败。 用户“Selase PC\Selase”登录失败。“ 我想我可以等几分钟,每次都再试一次,因为它在一段时间后再次成功登录,但这已经超出了人们的接受范围。我不能再等了,也不能一直等下去,所以我想从我可爱的朋友那里得到一些解决办法 它显示了一个很长的

我已经忍受了这个错误一段时间,但它已经达到了它的接受极限。我有一个“很好”的登录控件。很好,这意味着它通常能够成功地进行身份验证,但在其他时候,我尝试登录,就好像撞到了一堵看不见的墙。 “/”应用程序中的服务器错误。 无法打开用户默认数据库。登录失败。 用户“Selase PC\Selase”登录失败。“

我想我可以等几分钟,每次都再试一次,因为它在一段时间后再次成功登录,但这已经超出了人们的接受范围。我不能再等了,也不能一直等下去,所以我想从我可爱的朋友那里得到一些解决办法

它显示了一个很长的堆栈跟踪,我非常想告诉你们堆栈跟踪读取的内容,但请稍候

“/”应用程序中的“服务器错误”。 无法打开用户默认数据库。登录失败。 用户“Selase PC\Selase”登录失败。 描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源

异常详细信息:System.Data.SqlClient.SqlException:无法打开用户默认数据库。登录失败。 用户“Selase PC\Selase”登录失败

源错误:

在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来识别

堆栈跟踪:

[SqlException(0x80131904):无法打开用户默认数据库。登录失败。 用户“Selase PC\Selase”登录失败。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔断开连接)+5009598 System.Data.SqlClient.TdsParser.throweexception和warning()+234 System.Data.SqlClient.TdsParser.Run(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)+2275 System.Data.SqlClient.SqlInternalConnectionDS.CompleteLogin(布尔登记OK)+35 System.Data.SqlClient.sqlinternalconnectionds.AttemptOneLogin(ServerInfo ServerInfo,String newPassword,Boolean ignoresnopentimeout,TimeoutTimer timeout,SqlConnection owningObject)+183 System.Data.SqlClient.SqlInternalConnectionDS.LoginOfAliver(ServerInfo ServerInfo、String newPassword、Boolean redirectedUserInstance、SqlConnection owningObject、SqlConnectionString connectionOptions、TimeoutTimer timeout)+239 System.Data.SqlClient.sqlinternalconnectionds.OpenLoginEnlist(SqlConnection-owningObject、TimeoutTimer-timeout、SqlConnectionString-connectionOptions、String-newPassword、Boolean-redirectedUserInstance)+195 System.Data.SqlClient.SqlInternalConnectionDS..ctor(DbConnectionPoolIdentity,SqlConnectionString connectionOptions,Object providerInfo,String newPassword,SqlConnection owningObject,Boolean redirectedUserInstance)+232 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项、对象池组ProviderInfo、DbConnectionPool池、DbConnection owningConnection)+185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection所有者连接、DbConnectionPool池、DbConnectionOptions选项)+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.Web.DataAccess.SqlConnectionHolder.Open(HttpContext上下文,布尔值revertImpersonate)+95 System.Web.DataAccess.SqlConnectionHelper.GetConnection(字符串connectionString,布尔值还原模拟)+206 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(字符串用户名、布尔值updateLastLoginActivityDate、Int32和状态、字符串和密码、Int32和密码格式、字符串和密码盐、Int32和failedPasswordAttemptCount、Int32和failedPasswordAnswerAttemptCount、布尔值和isApproved、DateTime和lastLoginDate、DateTime和lastActivityDate) +827 System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名、字符串密码、布尔值updateLastLoginActivityDate、布尔值failIfNotApproved、字符串和salt、Int32和passwordFormat)+105 System.Web.Security.SqlMembershipProvider.ValidateUser(字符串用户名、字符串密码)+106 System.Web.UI.WebControls.Login.authenticateSingMembershipProvider(AuthenticateEventArgs e)+60 System.Web.UI.WebControls.Login.OnAuthenticate(authenticateventargs e)+129 System.Web.UI.WebControls.Login.AttemptLogin()+127 System.Web.UI.WebControls.Login.OnBubbleEvent(对象源,EventArgs e)+101 System.Web.UI.Control.RaiseBubbleEvent(对象源,EventArgs-args)+37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)+125 System.Web.UI.WebControl.Button.RaisePostBackEvent(String eventArgument)+167 System.Web.UI.WebControl.Button.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(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+5563

版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.1