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 252:
Line 253:        Dim result As Integer = 0
Line 254:        If Not Integer.TryParse(sqlCmd.ExecuteScalar.ToString(), result) Then
Line 255:            result = -1
Line 256:        End If

Source File: C:\Websites\portals\core\Community\Gallery\Display.aspx.vb    Line: 254

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Community_Gallery_Display.GetImageCommunityByImageID(Int32 id) in C:\Websites\portals\core\Community\Gallery\Display.aspx.vb:254
   Community_Gallery_Display.Page_Load(Object sender, EventArgs e) in C:\Websites\portals\core\Community\Gallery\Display.aspx.vb:48
   System.Web.UI.Control.OnLoad(EventArgs e) +105
   BasePage.OnLoad(EventArgs e) in C:\Websites\portals\www.mightymiramichi.com\App_Code\BasePage.vb:100
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3784


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