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 170:        object result = cmd.ExecuteScalar();
Line 171:        cxn.Close();
Line 172:        return result.ToString();
Line 173:
Line 174:    }

Source File: c:\Sites\garagedevaalv2\App_Code\FotoManager.cs    Line: 172

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   FotoManager.GetCarNameFromId(Int32 carid) in c:\Sites\garagedevaalv2\App_Code\FotoManager.cs:172
   FotoManager.GetFotos(Int32 carId) in c:\Sites\garagedevaalv2\App_Code\FotoManager.cs:55
   _nl_Detail.BindData() in c:\Sites\garagedevaalv2\en\Detail.aspx.cs:54
   _nl_Detail.Page_Load(Object sender, EventArgs e) in c:\Sites\garagedevaalv2\en\Detail.aspx.cs:19
   System.Web.UI.Control.OnLoad(EventArgs e) +105
   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.4069.0