Server Error in '/ofertaacademica' Application.

Object cannot be cast from DBNull to other types.

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.InvalidCastException: Object cannot be cast from DBNull to other types.

Source Error:


Line 222:
Line 223:            //valida si la carrera esta activa
Line 224:            if (Convert.ToBoolean(myreader["activo"]) == false)
Line 225:                Response.Redirect("mapaoferta.aspx");
Line 226:                                  

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

Stack Trace:


[InvalidCastException: Object cannot be cast from DBNull to other types.]
   System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider) +57
   ofertaacademica_interna.Page_Load(Object sender, EventArgs e) in c:\inetpub\www.udlap.mx\ofertaacademica\Default.aspx.cs:224
   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