加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – System.Data.EntityCommandExecutionException:执行

发布时间:2020-12-16 06:37:12 所属栏目:asp.Net 来源:网络整理
导读:我在mvc3应用程序中创建了一个连接字符串,它在mvc视图和控制器中工作正常,我能够获取数据.现在我在Test项目的单元测试中调用了存储库/模型函数,我收到错误: System.Data.EntityCommandExecutionException: An error occurred while executing the command d
我在mvc3应用程序中创建了一个连接字符串,它在mvc视图和控制器中工作正常,我能够获取数据.现在我在Test项目的单元测试中调用了存储库/模型函数,我收到错误:

System.Data.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Invalid object name 'dbo.tblProduct'.

我该如何解决?

解决方法

这与MVC无关.看起来,在测试时,您在没有’dbo.tblProduct’表/视图的数据库上使用ConnectionString.检查连接字符串和数据库.您可能需要调试测试

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读