Server Error in '/' Application.

Unable to refresh the specified object.  The object no longer exists in the database.

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.InvalidOperationException: Unable to refresh the specified object.  The object no longer exists in the database.

Source Error:


Line 19:             _news = News_rg.GetNews_rg(Convert.ToInt32(myParent.RouteValue("Control").ToString()));
Line 20:             _news.ViewCount = _news.ViewCount + 1;
Line 21:             _news.Update();
Line 22:         }
Line 23:     }

Source File: c:\inetpub\wwwroot\firstarmour.com\Public\Controls\News\View.ascx.cs    Line: 21

Stack Trace:


[InvalidOperationException: Unable to refresh the specified object.  The object no longer exists in the database.]
   System.Data.Linq.DataContext.Refresh(RefreshMode mode, IEnumerable entities) +1266576
   Project.Core.Utilities.SQLCoordinator.Update(Type type, Object obj, Object sender, Boolean fireEvents) in E:\MAJDI\Old D\KIG System 2016\CMS_KIG\Project\Project.core\Utilities\SQLCoordinator.cs:50
   Project.Core.Utilities.SQLCoordinator.AddOperation(Object obj, SQLOperationType sqlOPType) in E:\MAJDI\Old D\KIG System 2016\CMS_KIG\Project\Project.core\Utilities\SQLCoordinator.cs:82
   Project.Core.Site.News_rg.Update() in E:\MAJDI\Old D\KIG System 2016\CMS_KIG\Project\Project.core\Site\News_rg.cs:68
   Public_Controls_News_View.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\firstarmour.com\Public\Controls\News\View.ascx.cs:21
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Control.LoadRecursive() +162
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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