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

ExecuteReader 要求已打开且可用的连接。连接的当前状态为已关闭。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: ExecuteReader 要求已打开且可用的连接。连接的当前状态为已关闭。

源错误:


行 148:        {
行 149:            SqlCommand cmd = CreateCommand(procName, prams);
行 150:            dataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
行 151:        }
行 152:        #endregion

源文件: d:\ceshi\App_Code\Database.cs    行: 150

堆栈跟踪:


[InvalidOperationException: ExecuteReader 要求已打开且可用的连接。连接的当前状态为已关闭。]
   System.Data.SqlClient.SqlConnection.GetOpenConnection(String method) +6338550
   System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command) +13
   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +213
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +146
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +211
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +87
   WebApp.Components.Database.RunProc(String procName, SqlParameter[] prams, SqlDataReader& dataReader) in d:\ceshi\App_Code\Database.cs:150
   WebApp.Components.Time.GetTimeLimit(Int32 intID) in d:\ceshi\App_Code\Time.cs:23
   WebApp.Components.Common.showTimeLimit() in d:\ceshi\App_Code\Common.cs:170
   WebApp.Components.SystemTools.showTimeLimit() in d:\ceshi\App_Code\SystemTools.cs:62
   _Default.Page_Load(Object sender, EventArgs e) in d:\ceshi\Default.aspx.cs:44
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


版本信息: Microsoft .NET Framework 版本:2.0.50727.8806; ASP.NET 版本:2.0.50727.8762