首页上一页 1 下一页尾页 1 条记录 1/1页
《典型模块》实例一 XMLBBS 无法登陆
发表在ASP.NET图书答疑
2010-05-12
是否精华
是
否
版块置顶:
是
否
这是书上的原代码,首页运行没问题,但是登录的时候出错。
无论是管理员账号,还是注册新用户,都出错。
“/”应用程序中的服务器错误。
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
源错误:
行 135: if(sqlCon.State == ConnectionState.Closed)
行 136: {
行 137: sqlCon.Open();
行 138: }
行 139: ///设置SqlCommand的属性
源文件: e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs 行: 137
堆栈跟踪:
[SqlException (0x80131904): 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820
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
MRSOFTASPNET.OperateSqlServer.OperateDatabase.CreateSqlCommand(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:137
MRSOFTASPNET.OperateSqlServer.OperateDatabase.RunProc(String procName, SqlDataReader& dr, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:363
MRSOFTASPNET.XmlBBS.User.GetUserLogin(String name, String password) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\User.cs:54
ProjectBBS_UserLogin.btnLogin_Click(Object sender, ImageClickEventArgs e) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\ProjectBBS\UserLogin.aspx.cs:50
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 includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
无论是管理员账号,还是注册新用户,都出错。
“/”应用程序中的服务器错误。
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
源错误:
行 135: if(sqlCon.State == ConnectionState.Closed)
行 136: {
行 137: sqlCon.Open();
行 138: }
行 139: ///设置SqlCommand的属性
源文件: e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs 行: 137
堆栈跟踪:
[SqlException (0x80131904): 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820
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
MRSOFTASPNET.OperateSqlServer.OperateDatabase.CreateSqlCommand(String procName, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:137
MRSOFTASPNET.OperateSqlServer.OperateDatabase.RunProc(String procName, SqlDataReader& dr, SqlParameter[] prams) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\OperateDatabase.cs:363
MRSOFTASPNET.XmlBBS.User.GetUserLogin(String name, String password) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\App_Code\User.cs:54
ProjectBBS_UserLogin.btnLogin_Click(Object sender, ImageClickEventArgs e) in e:\ASP.NET开发典型模块大全\mr\01\XMLBBS\ProjectBBS\UserLogin.aspx.cs:50
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 includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102