Server Error in '/ofertaacademica' Application.

There is already an open DataReader associated with this Command which must be closed first.

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.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

Source Error:


Line 376:            string queryModuloContacto = "SELECT claveCarrera, descripcionCarrera" + dbCampoIdioma + " FROM cat_carreras WHERE activo = 'true' AND claveGrado = '" + claveGrado + "' AND claveCarrera!='MZS' ORDER BY descripcionCarrera" + dbCampoIdioma;
Line 377:            SqlCommand queryContacto = new SqlCommand(queryModuloContacto, myConnection);            
Line 378:            myreader = queryContacto.ExecuteReader();
Line 379:            //Response.Write(queryModuloContacto);
Line 380:

Source File: c:\inetpub\www.udlap.mx\ofertaacademica\Default.aspx.cs    Line: 378

Stack Trace:


[InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.]
   System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command) +357
   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +311
   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) +155
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +83
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +190
   System.Data.SqlClient.SqlCommand.ExecuteReader() +147
   ofertaacademica_interna.Page_Load(Object sender, EventArgs e) in c:\inetpub\www.udlap.mx\ofertaacademica\Default.aspx.cs:378
   System.Web.UI.Control.OnLoad(EventArgs e) +86
   System.Web.UI.Control.LoadRecursive() +129
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3712


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