解决Entity Framework Code First 的问题——Model compatibility cannot be checked because the database
来源:互联网 发布:知乎发帖 编辑:程序博客网 时间:2024/04/30 02:56
解决Entity Framework Code First 的问题——Model compatibility cannot be checked because the database does not contain model metadata
这两天在虚拟机里重新学习了一下ASP.NET MVC,然后就在Codeplex网站里面找到MVCMusicStore的代码进行研究,跟着它的代码一步一步学习下去。结果在使用EF的时候映射数据的时候,出现了下面的问题。如图:
错误的提示为:Model compatibility cannot be checked because the database does not contain model metadata.Model compatibility can only be checked for databases created using Code First or Code First Migrations.
解决方法:
USE [master]GO/****** Object: Database [DBname] ******/ ALTER DATABASE [DBname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE [DBname] SET SINGLE_USER WITH NO_WAIT DROP DATABASE [DBname] GO
DBname 即为你的数据库名称,执行完上面的这段Sql语句,上面出现的问题就解决了。
0 0
- 解决Entity Framework Code First 的问题——Model compatibility cannot be checked because the database
- mvc3.0 报错Model compatibility cannot be checked because the database does not contain model metadata
- Model First、Database First、Code First – 如何选择合适的Entity Framework开发方法
- Entity Framework 4中的Code-First, Model-First和Database-First模式
- Entity Framework 4中的Code-First, Model-First和Database-First模式
- Entity Framework 4中的Code-First, Model-First和Database-First模式
- 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. )问题
- C# ORM—Entity Framework 之Database first(数据库优先)&Model First(模型优先)(一)
- 解决 service cannot be activated because it requires ASP.NET compatibility. ASP.NET compatibility is
- Entity Framework Model First
- Entity Framework Model First
- 如何解决打开xcode项目是遇到的“cannot be opened because the project file cannot be parsed.”问题?
- MySQL & Entity Framework Code First 数据表大小写的问题
- Entity Framework code first 手动修改数据库的问题
- MySQL & Entity Framework Code First 数据表大小写的问题
- Entity framework 4.1 code first: 问题
- Entity Framework Code first
- Entity Framework-Code First to a New Database
- Delphi2007-Delphi2010 程序不出现在任务栏的方法
- chinese-calender研究日志一(环境搭建与调试)
- $_SERVER详解($_SERVER[PHP_SELF],$_SERVER[SCRIPT_NAME],$_SERVER['REQUEST_URI']与HTTP_HOST和SERVER_NAM的区别)
- XCL-Charts图表库中柱形图的同源风格切换介绍
- repeated_permutation
- 解决Entity Framework Code First 的问题——Model compatibility cannot be checked because the database
- Linux下文件夹的权限解读
- dbcTemplate
- firebug最新版本在firefox30上没法运行
- 纸质笔记整理(二)
- hdu 2037 今年暑假不AC
- FMDB with SQLCipher Tutorial
- sqlserver事务与回滚
- Handler和HandlerThread