首页上一页 1 下一页尾页 1 条记录 1/1页
ASP.NET案例模块开发讲座 CHAPTER 11 无法连接数据库
发表在ASP.NET图书答疑
2011-04-05
是否精华
是
否
版块置顶:
是
否
'/RegisterLogin' 应用程序中发生服务器错误。
________________________________________
无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。
描述: 在执行目前 Web 要求的过程中发生未处理的例外情形。请检阅堆栈追踪以取得错误的详细信息,以及在程序代码中产生的位置。
例外详细信息: System.Data.SqlClient.SqlException: 无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。
原始程序错误:
行 99: SqlConnection con = new SqlConnection(@"Data Source=(local)\SQLEXPRESS;Initial Catalog=db_Register;Integrated Security=True;");
行 100: //打开数据库连接
行 101: con.Open();
行 102: //创建SqlCommand对象
行 103: SqlCommand com = new SqlCommand(sqlSel, con);
原始程序文件: c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs 行: 101
堆栈追踪:
[SqlException (0x80131904): 无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4856727
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1121
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +340
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +225
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
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) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +431
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
Register.isName() in c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs:101
Register.txtName_TextChanged(Object sender, EventArgs e) in c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs:157
System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +8753970
System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +55
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
________________________________________
版本信息: Microsoft .NET Framework 版本:2.0.50727.5420; ASP.NET 版本:2.0.50727.5420
________________________________________
无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。
描述: 在执行目前 Web 要求的过程中发生未处理的例外情形。请检阅堆栈追踪以取得错误的详细信息,以及在程序代码中产生的位置。
例外详细信息: System.Data.SqlClient.SqlException: 无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。
原始程序错误:
行 99: SqlConnection con = new SqlConnection(@"Data Source=(local)\SQLEXPRESS;Initial Catalog=db_Register;Integrated Security=True;");
行 100: //打开数据库连接
行 101: con.Open();
行 102: //创建SqlCommand对象
行 103: SqlCommand com = new SqlCommand(sqlSel, con);
原始程序文件: c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs 行: 101
堆栈追踪:
[SqlException (0x80131904): 无法开启登入所要求的数据库 "db_Register"。登入失败。
使用者 'USER-PC\User' 的登入失败。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4856727
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1121
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +340
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +225
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
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) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +431
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
Register.isName() in c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs:101
Register.txtName_TextChanged(Object sender, EventArgs e) in c:\inetpub\wwwroot\ASP.NET\mr\11\RegisterLogin\Register.aspx.cs:157
System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e) +8753970
System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent() +55
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
________________________________________
版本信息: Microsoft .NET Framework 版本:2.0.50727.5420; ASP.NET 版本:2.0.50727.5420