首页上一页 1 下一页尾页 1 条记录 1/1页
典型开发模块
发表在ASP.NET图书答疑
2010-01-13
是否精华
是
否
版块置顶:
是
否
网页开得了 但是又出现登陆错误 我改了SQL2005的登陆名是sa 密码没设置 为什么还是登陆失败
不是改了登陆名和密码后 在web.config改SQL的服务器名就可以了吗?
无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 '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: 无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 'sa' 登录失败。
Source Error:
Line 135: if(sqlCon.State == ConnectionState.Closed)
Line 136: {
Line 137: sqlCon.Open();
Line 138: }
Line 139: ///设置SqlCommand的属性
Source File: e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs Line: 137
Stack Trace:
[SqlException (0x80131904): 无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 'sa' 登录失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
MRSOFTASPNET.OperateSqlServer.OperateDatabase.CreateSqlCommand(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:137
MRSOFTASPNET.OperateSqlServer.OperateDatabase.RunProcScalar(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:538
MRSOFTASPNET.XmlBBS.User.CheckUser(String userName) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\User.cs:42
ProjectBBS_UserRegister.btnCheckUser_Click(Object sender, EventArgs e) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\ProjectBBS\UserRegister.aspx.cs:84
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) +1746
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
不是改了登陆名和密码后 在web.config改SQL的服务器名就可以了吗?
无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 '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: 无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 'sa' 登录失败。
Source Error:
Line 135: if(sqlCon.State == ConnectionState.Closed)
Line 136: {
Line 137: sqlCon.Open();
Line 138: }
Line 139: ///设置SqlCommand的属性
Source File: e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs Line: 137
Stack Trace:
[SqlException (0x80131904): 无法打开登录所请求的数据库 "db_XMLBBS"。登录失败。
用户 'sa' 登录失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
MRSOFTASPNET.OperateSqlServer.OperateDatabase.CreateSqlCommand(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:137
MRSOFTASPNET.OperateSqlServer.OperateDatabase.RunProcScalar(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:538
MRSOFTASPNET.XmlBBS.User.CheckUser(String userName) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\User.cs:42
ProjectBBS_UserRegister.btnCheckUser_Click(Object sender, EventArgs e) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\ProjectBBS\UserRegister.aspx.cs:84
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) +1746
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433