Server Error in '/' Application.

Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 162:        Dim cmd As New OleDbCommand(sql, cn)
Line 163:        cmd.Parameters.AddWithValue("CompID", CompID)
Line 164:        Dim CompTypeFromCompData As String = cmd.ExecuteScalar.ToString
Line 165:
Line 166:        Return CompTypeFromCompData

Source File: E:\web\glidersc\App_Code\GlobalVBCode.vb    Line: 164

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   GlobalVBCode.getCompTypeFromCompData(String CompID) in E:\web\glidersc\App_Code\GlobalVBCode.vb:164
   ASP.escoring_aspx.OnLoad(EventArgs e) in E:\web\glidersc\eScoring.aspx:55
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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