2014年7月的时候,写了一篇关于EF5 with visual studio 2010 for oracle 11g的博文 原文地址 :http://www.cnblogs.com/HouZhiHouJueBlogs/p/3844028.html,现在oracle已经支持到EF6了。技术更新快,有些细节如不记录下来,很容易被遗忘,故有此篇博文。

  Oracle 对.net支持的一些基础知识了解介绍

1.早年的时候,微软自己做的有 System.Data.OracleClient。 现在已经成了过期类了。性能等都不是很好。

2.Oracle 官方出的odp.net  Oracle.DataAccess.dll(非托管版本) 还要分32/64位。而且很麻烦的是 部署的时候 需要装客户端环境。非常繁琐。

3.Oracle 官方近年新出的  Oracle.ManagedDataAccess.dll  这个非常给力 不再区分32/64位了。 而且不需要客户端再安装东西了。性能也得到了提高。不管是用ado.net或者其他ORM框架都建议使用此版本dll。这次我们的EF6 也会依据此dll进行开发。

官方下载地址是这个 一定要去官方下载最新的 才能支持EF6  我从nuget上下的版本较低 不支持。。

http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html  (当时下载的版本为4.121.2.0)。下载好后,部署的方式十分简单,进入cmd窗口执行installxx的命令即可,后面会提示参数。

下载好后  从这个目录下 odp.net\managed\common  拿出Oracle.ManagedDataAccess.dll 和 Oracle.ManagedDataAccess.EntityFramework.dll ,已备开发使用。

使用codefirst需要有相关配置,如下:

<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections> <entityFramework>
<defaultConnectionFactory type="Oracle.ManagedDataAccess.EntityFramework.OracleConnectionFactory,
Oracle.ManagedDataAccess.EntityFramework,
Version=6.121.2.0,
Culture=neutral,
PublicKeyToken=89b483f429c47342" />
<providers>
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </providers>
</entityFramework> <system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data> <connectionStrings> <add name="OraString" connectionString="Data Source= (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *****)(PORT = ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
);User ID=*****;Password=*****;Persist Security Info=True" providerName="Oracle.ManagedDataAccess.Client" /> </connectionStrings>

这里还有个注意事项,因为有的人以及装了oracle的客户端。这可能会导致一些错误。这里 请注意检查下  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config

下的  machine.config (64位的话 路径是 Framework64,最好都检测下)

machine.config 可以理解为webconfig的父类 所以我们需要检查下里面的内容  是否有:

<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

上述配置完成之后,EF6即可投入使用。

参考链接:

http://www.cnblogs.com/wlflovenet/p/4187455.html

http://www.cnblogs.com/yzb305070/p/4251036.html

oracle 访问的问题:

http://docs.oracle.com/cd/E56485_01/win.121/e55744/toc.htm

http://docs.oracle.com/cd/E56485_01/win.121/e55744/entityMigrate.htm#BABEHEFE

Entity Framework6 with Visual Studio 2013 update3 for Oracle 11g的更多相关文章

  1. Solve: Your project references the latest version of Entity Framework (for MySQL) in Visual Studio 2013

    The error message while trying to create a ADO.net Entity Data Model ( Entity Framework 6 ) for MySq ...

  2. Visual Studio 2013 Web开发

    cnbeta新闻:微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Ser ...

  3. Visual Studio 2013 Preview 新功能

    先来看一下Visual Studio的版本历史: 1. Visual Studio.NET 2002 2. Visual Studio.NET 2003 3. Visual Studio.NET 20 ...

  4. Visual Studio 2013 EF5实体数据模型 EDMX 使用 T4模板生成后使用 ObjectContext对象

    Visual Studio 2013 EF5实体数据模型 EDMX 使用 T4模板生成后的继承对象为DbContext,以前的熟悉的ObjectContext对象不见了,当然使用ObjectConte ...

  5. Visual Studio 2013 Web开发、新增功能:“Browser Link”

    微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...

  6. 使用visual studio 2013 快速搭建phonegap开发环境

    前一段时间开发了一款简单的Phonegap应用,遇到了很多坑,其中有一个坑就是在搭建开发环境上.由于Phonegap 2.x 与3.x 区别比较大,导致了开发环境也有所不同.2.x 是这样的http: ...

  7. 在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移

    在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移 最近发布的ASP.NET MVC 5 及Visual ...

  8. Visual Studio 2013 Web开发、新增功能:“Browser Link”

    微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...

  9. Visual Studio 2013 发布正式版

    SELECT COUNT(1) 和SELECT COUNT(*)哪个性能好? Visual Studio 2013 发布正式版及使用感受 (注意:文末我添加了一个小节,用来更新最新的一些使用感受.) ...

随机推荐

  1. Page.FindControl(string id) 与母版页结合后发现的一个问题

    MSDN上解释Page.FindControl(string id)方法用于查找指定ID的控件.例如: <asp:TextBox id="Email" runat=" ...

  2. QTP如何准确识别Dialog中的对象

    QTP脚本中有一个点击网页弹出框确定按钮的操作,实际运行时发现存在问题:调试过程,可正常识别并点击:但批量运行时不能识别并点击的概率接近100%. 修改WinButton的其中一个对象属性后,该问题解 ...

  3. 973. K Closest Points to Origin

    We have a list of points on the plane.  Find the K closest points to the origin (0, 0). (Here, the d ...

  4. 4.iptables 网络防火墙

    [1] #如果想要iptables作为网络防火墙,iptables所在主机开启核心转发功能,以便能够转发报文. [2] #使用如下命令查看当前主机是否已经开启了核心转发,0表示为开启,1表示已开启 c ...

  5. Quartz.Net_表达式参考说明

    字段名 允许的值 允许的特殊字符 秒 0-59 , - * / 分 0-59 , - * / 小时 0-23 , - * / 日 1-31 , - * ? / L W C 月 1-12 , - * / ...

  6. 跟刘欣学习造spring

    1: 读取配置文件并获取对象实例

  7. js数组的常用操作

    数组合并 var arr=[1,"abc","张三","122"]; var b=["今天天气不错","适合学 ...

  8. 2016级算法第一次练习赛-D.AlvinZH的儿时回忆——跳房子

    864 AlvinZH的儿时回忆----跳房子 题目链接:https://buaacoding.cn/problem/864/index 思路 这是一道简单题,但是同样有人想复杂了,DP?大模拟?. ...

  9. 搭建USB摄像头转RTSP服务器的多种方法

    USB摄像头与网络摄像头相比,可选择范围广.种类多.成本低,但是实际使用时需要通过rtsp流来访问,起到直播的效果,因此在摄像头采集终端上构建rtsp流媒体服务器,将USB摄像头数据转化为rtsp,可 ...

  10. 863公司 linux软测题

    1.浏览目录命令 2.浏览文件命令 3.目录操作命令 4.文件操作命令 5.进程管理命令