Server Error in '/' Application.

System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
  at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
  at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
  at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
  at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
  at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType)
  at XL_BANG.Doc_bang() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs:line 73

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.Exception: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
  at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
  at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
  at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
  at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
  at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType)
  at XL_BANG.Doc_bang() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs:line 73

Source Error:


Line 79:         catch (Exception ex)
Line 80:         {
Line 81:             throw new Exception(ex.ToString());
Line 82:         }
Line 83:     }

Source File: d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs    Line: 81

Stack Trace:


[Exception: System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
   at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
   at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
   at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataTable dataTable, SchemaType schemaType)
   at XL_BANG.Doc_bang() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs:line 73]
   XL_BANG.Doc_bang() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs:81
   XL_BANG..ctor(String pTen_bang, String pChuoi_SQL) in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyLuuTru\XL_BANG.cs:54
   BANG_tbl_Menu..ctor(String pChuoi_SQL) in d:\inetpub\vhosts\spchcmc.vn\httpdocs\App_Code\LopXuLyNghiepVu\BANG_tbl_Menu.cs:16
   EN_Usercontrol_MenuTop.LoadMenuCapI() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\EN\Usercontrol\MenuTop.ascx.cs:23
   EN_Usercontrol_MenuTop.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\spchcmc.vn\httpdocs\EN\Usercontrol\MenuTop.ascx.cs:17
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3429.0