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 62:                 tblProductMaster loProduct = moProductDetail.tblProductMasters.Where(c => c.flgIsDeleted == false && c.inProductId == Convert.ToInt32(Request.QueryString["pid"])).FirstOrDefault();
Line 63:                 tblProductCategoryMapping loProductMap = moProductDetail.tblProductCategoryMappings.Where(c => c.flgIsDeleted == false && c.inProductId == Convert.ToInt32(Request.QueryString["pid"])).FirstOrDefault();
Line 64:                 liSubCategoryID = Convert.ToInt32(loProductMap.inCategoryId);
Line 65:                 tblCategoryMaster loSubCategory = moProductDetail.tblCategoryMasters.Where(c => c.inCategoryId == liSubCategoryID).FirstOrDefault();
Line 66:                 liCategoryID = Convert.ToInt32(loSubCategory.inCategoryId);

Source File: c:\inetpub\vhosts\pioneeradhesives.com\httpdocs\ProductDetails.aspx.cs    Line: 64

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ProductDetail.insertMetaDetails() in c:\inetpub\vhosts\pioneeradhesives.com\httpdocs\ProductDetails.aspx.cs:64
   ProductDetail.Page_PreRender(Object sender, EventArgs e) in c:\inetpub\vhosts\pioneeradhesives.com\httpdocs\ProductDetails.aspx.cs:49
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnPreRender(EventArgs e) +8788774
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062