Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET MVC3对象名称无效';位置跟踪';_Asp.net_Asp.net Mvc 3_C# 4.0_Entity Framework 4.1 - Fatal编程技术网

ASP.NET MVC3对象名称无效';位置跟踪';

ASP.NET MVC3对象名称无效';位置跟踪';,asp.net,asp.net-mvc-3,c#-4.0,entity-framework-4.1,Asp.net,Asp.net Mvc 3,C# 4.0,Entity Framework 4.1,我有一个MVC3应用程序,是从另一个开发人员那里收到的。我已经设置了正确的数据库并将其添加到我的Web.config中。有一个称为位置的模型和控制器 添加位置的控制器和视图是非常标准的CRUD,但是当我尝试添加位置时,Create方法抛出以下命令: Invalid object name 'Locations_tracking'. Description: An unhandled exception occurred during the execution of the current w

我有一个MVC3应用程序,是从另一个开发人员那里收到的。我已经设置了正确的数据库并将其添加到我的Web.config中。有一个称为位置的模型和控制器

添加位置的控制器和视图是非常标准的CRUD,但是当我尝试添加位置时,Create方法抛出以下命令:

Invalid object name 'Locations_tracking'.

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.Data.SqlClient.SqlException: Invalid object name 'Locations_tracking'.

Source Error: 


Line 56:                 location.UpdatedAt = DateTime.Now;
Line 57:                 db.Locations.Add(location);
Line 58:                 db.SaveChanges();
Line 59:                 return RedirectToAction("Index");  
Line 60:             }

我在整个应用程序中搜索了“跟踪”,但没有找到任何东西。为什么它要寻找这个“位置跟踪”对象,为什么它找不到?我假设它来自实体框架,因为我在控制器、模型或视图中看不到任何东西。谢谢你的帮助

这是一个SQL异常。它似乎正在尝试更新/插入不存在的表
Locations\u tracking
。除了继承应用程序外,您是否还继承了允许您创建此应用程序所依赖的数据库结构的SQL脚本?

在Locations表中查找触发器。考虑到这里缺少的表的命名,我认为它是一个由触发器提供的用于插入和更新的审计表。如果是这样的话,您可能有触发器,但没有表。

这正是它的本来面目。该数据库是为MS Sync Framework准备的,后者添加了触发器和额外的表。以前的管理员删除了跟踪表,但没有删除触发器。非常感谢。