使用Entity Framework时遇到的问题
1、运行程序时提示 ,vension does not match. 差不多是这样一个提示,具体怎么样的给忘记了。
#1remove 'entity framework' from reference
#2update the app.config to 6.0.0
#3use Nuget to install Entity Framework: install-package entityframework
sometimes ,the Nuget prompts :the project has already installed entity framework.
now you shoud go to package.config to remove the entity framework tag
then you should repeat #3
2 使用entity framework的情况下,运行程序,提示 cannot load sql.data.sqlClient
you should go the class that extend the DBContext,to add a static constructor, as below
static myDBContext()
{
var _ = typeof(System.Data.Entity.SqlServer.SqlProviderServices);
var __ = typeof(System.Data.Entity.SqlServerCompact.SqlCeProviderServices); // I comment out this line ,because cannot find namespace SqlServerCompact
}
补充一点 ,entity framework 会自动在config文件里添加一个配置
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider ...............“sql.data.sqlClient”......./> //差不多是这个样子的
<providers>
</entityFramework>
去掉providers节点。
3 找不到命名空间System.Data.Objects
需要引用System.Data.Entiy
使用Entity Framework时遇到的问题的更多相关文章
- 使用Entity Framework时,序列化出错
在使用Entity Framework时,如果数据库中有两个表是一对多或者是多对多的关系,那么生成的实体类中就有一个导航属性.这个导航属性前面都加上了一个virtual关键字.这个v ...
- ASP.Net MVC-Web API使用Entity Framework时遇到Loop Reference
原文地址:http://www.it165.net/pro/html/201210/3932.html 最近开始研究Web API,运气不错第一个测试项目就遇到问题@@-当新增Control时选择[A ...
- 使用Entity Framework时遇到的各种问题总结
在这里记录一下之前使用Entity Framework(4.3.1版本)遇到的问题. 更新没有设置主键的表 在默认情况下,EF不能对一个没有主键的表进行更新.插入和删除的动作.用xml方式查看edmx ...
- 关于使用Entity Framework时遇到的问题 未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架提供程序。请确保在应用程序配置文件的“entityFramework”节中注册了该提供程序
问题描述: 使用Entity Framework获取数据时报以下错误: 未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架提供程序.请确保在应用程序 ...
- 使用Entity Framework时要注意的一些性能问题
http://diaosbook.com/Post/2012/12/9/performance-issue-in-select-one-or-few-colums-via-entityframewor ...
- 【藏】使用Entity Framework时要注意的一些性能问题
这篇文章写的很好: http://diaosbook.com/Post/2012/12/9/performance-issue-in-select-one-or-few-colums-via-enti ...
- AppBox升级进行时 - 关联表查询与更新(Entity Framework)
AppBox 是基于 FineUI 的通用权限管理框架,包括用户管理.职称管理.部门管理.角色管理.角色权限管理等模块. 关联表的查询操作 使用 Include 方法,我们可以在一次数据库查询中将关联 ...
- Entity framework在用于WCF时创建数据模型的问题
众所周知,WCF的传输对象,在创建时需要在类名上标识[DataContract]以及在属性上标识[DataMember],当我们在使用Entity framework时(不考虑Code first的情 ...
- 在Entity Framework 4.0中使用 Repository 和 Unit of Work 模式
[原文地址]Using Repository and Unit of Work patterns with Entity Framework 4.0 [原文发表日期] 16 June 09 04:08 ...
随机推荐
- BigInteger和BigDecimal的练习
前言: BigInteger用于处理大数据的计算,它继承自java.math.BigInteger.用法相对来说比较简单,掌握几个基本运算即可. 初始化: BigInteger sum=new Big ...
- Asp.Net 常用工具类之Office-文档操作(6)
文档一直是老大难问题,君不知,代码用时方恨少!有一套成熟的文件帮助类能很大程度上减少寻找各种资料的时间. 记得以前做一个业务,需要导出协议,一份可编辑,一份不可编辑.那么Word和PDF是最好的选择, ...
- 为什么Node.JS会受到青睐?
为什么会是Node.JS? 从技术上讲,Node.JS不是一个非常好的项目,Node.JS只是把一个烂想法实现到了可以接受的程度. 但是人们为什么愿意用Node.JS? 从历史看来,成功的项目从来都不 ...
- 1036: [ZJOI2008]树的统计Count
1036: [ZJOI2008]树的统计Count Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 7496 Solved: 3078[Submit] ...
- 深入理解java虚拟机之——JVM垃圾回收策略总结
如何判断一个对象是否存活 引用计数算法:给对象中添加一个引用计数器,每当有引用它时,计数器值就加1:当引用失效时,计数器值就减1:任何时刻计数器为0的对象就是不可能再被使用. Java虚拟机里面没有 ...
- python 语法笔记(一)
#python3里面input默认接收到的事str类型,而python2里面却认为是int类型n=int(input('请输入想要第几个数')) #如果将int省去,python3中该程序将会报错a, ...
- iOS UI控件总结(全)
1.UIButton UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake ...
- PHP语言开发微信公众平台(订阅号)之注册
1.百度搜索"微信公众平台" 2.选择微信公众平台官网并单击打开 3.进入官网页面,单击 "立即注册" 进入注册页面 4.进入注册页面,单击订阅号 5.进入订阅 ...
- checkSelfPermission 找不到 Android 动态权限问题
checkSelfPermission 找不到 Android 动态权限问题 最近写了一个Demo,以前好好地.后来手机更新了新系统以后,不能用总是闪退.而且我的小伙伴的是android 7.0系统 ...
- 阿里云Linux启动tomcat并能外网访问
问题描述: 先描述一下我的心路历程吧,新买了阿里云服务器,由于需求不是很大,只是为了备案,所以买了个最低配的,而且是Windows server2012的.那现在需要做的是在这个乞丐版的server上 ...