Server Error in '/' Application.

SchoolName

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.IndexOutOfRangeException: SchoolName

Source Error:


Line 27:                     while (dr.Read())
Line 28:                     {
Line 29:                         DDPupil.Items.Add(new ListItem(dr["code"].ToString() + " (" + dr["SchoolName"].ToString().Trim() + ")", dr["code"].ToString()));
Line 30:                     }
Line 31:                     connection.Close();

Source File: e:\Websites\college.bishops.org.za\triangular\PupilResults.aspx.cs    Line: 29

Stack Trace:


[IndexOutOfRangeException: SchoolName]
   System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +2158731
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +141
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +21
   triangular_PupilResults.Page_Load(Object sender, EventArgs e) in e:\Websites\college.bishops.org.za\triangular\PupilResults.aspx.cs:29
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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