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 140:
Line 141:                _articles = DataContext.ArticleOnes.Where(c => c.LeadName == leadName).SingleOrDefault();
Line 142:                _articles.ViewCount++;
Line 143:                DataContext.SubmitChanges();
Line 144:            }

Source File: C:\Inetpub\vhosts\datatorch.com\httpdocs\life\articles.aspx.cs    Line: 142

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   life_articles.get_Articles() in C:\Inetpub\vhosts\datatorch.com\httpdocs\life\articles.aspx.cs:142
   life_articles.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\datatorch.com\httpdocs\life\articles.aspx.cs:98
   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.4087.0