当前位置:编程学习 > C#/ASP.NET >>

[在线等]无法打开用户默认数据库。登录失败。

“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

无法打开用户默认数据库。登录失败。
用户 'TJU-57C4232FC30\ASPNET' 登录失败。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Data.SqlClient.SqlException: 无法打开用户默认数据库。登录失败。
用户 'TJU-57C4232FC30\ASPNET' 登录失败。

源错误: 


行 26:             return;
行 27:         }
行 28:         if (Membership.ValidateUser(userName, userPass))
行 29:         {
行 30:             FormsAuthentication.RedirectFromLoginPage(userName, false);
 

源文件: d:\QAOA\R_Index.aspx.cs    行: 28 

堆栈跟踪: 


[SqlException (0x80131904): 无法打开用户默认数据库。登录失败。
用户 'TJU-57C4232FC30\ASPNET' 登录失败。]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735059
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
   System.Web.Security.Membership.ValidateUser(String username, String password) +43
   R_Index.ImageButton1_Click(Object sender, ImageClickEventArgs e) in d:\QAOA\R_Index.aspx.cs:28
   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean 
 

是数据库连接有问题吗.还是怎么回事?老师记着催命啊,请高手大哥伸出您的援助之手,我这里的橄榄枝替你准备了一篮子.^_^
--------------------编程问答-------------------- ASPNET用户没权限,用sa用户
  
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 

最新版本:20070130

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html --------------------编程问答-------------------- ConnectionString中的uid 改成授权用户 如sa --------------------编程问答-------------------- 你换一个数据库登录的用户名试试. --------------------编程问答-------------------- SQL server2005里面的账户怎么查看 --------------------编程问答-------------------- 用户可能有问题 --------------------编程问答-------------------- 用户 'LUDELI2004\ASPNET' 登录失败。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Data.SqlClient.SqlException: 用户 'LUDELI2004\ASPNET' 登录失败。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

堆栈跟踪: 


[SqlException (0x80131904): 用户 'LUDELI2004\ASPNET' 登录失败。]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735123
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   _Default.Button1_Click(Object sender, EventArgs e) +212
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
 
我用IIS发布后,也是不能登录 ,求哪位大哥帮帮我,在线等后 --------------------编程问答-------------------- http://www.chinaitpower.com/A/2004-04-14/77515.html

============================================================================== 
按照我的出现的Exception,我的解决方法如下: 
1、在SQL Server创建 “电脑名\ASPNET”用户。比如我创建HP-2V47VI88M4GB\ASPNET 
2、在SQL Enterprise manager里打开“安全性”文件夹,右击“登录”,选择“新建登录……”。“常规”选项卡,“名称”填HP-2V47VI88M4GB\ASPNET,其他默认;“数据库访问”选项卡,指定访问的数据库,我指定的是Northwind数据库,然后给他赋权限:dbo,public就够了。 --------------------编程问答-------------------- http://topic.csdn.net/t/20031001/09/2319314.html
http://www.ttscj.cn/info/59692.htm
http://blog.csdn.net/myohmine/archive/2006/05/24/752251.aspx
你自己完全可以搜索得到的,唉。。。。。。。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,