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. 使用PLSQL Developer时中文乱码问题

    使用PLSQL Developer时中文乱码问题 一.问题: 执行一些查询结果有中文的SQL语句,显示不了中文,显示???. 二.产生的原因: 客户端与服务器端的编码不一致造成的. 三.解决方案: 1 ...

  2. Android学习之 adb被占用解决办法

    1.adb被占用解决办法 方法一:(1)查看5037端口哪个进程在用          netstat -a -o 5037 (2)查看上面进程是哪个执行文件在占用          tasklist ...

  3. django重写form表单中的局部钩子函数

    from django import forms from django.core.exceptions import ValidationError from jax import models c ...

  4. 用JS实现汉字转拼音

    <!DOCTYPE HTML> <html> <head> <title>用JS实现汉字转拼音</title> <meta chars ...

  5. JMeter—系统性能分析思路

    系统在工作负载中的性能受到许多因素影响,处理器速度.内存容量.网络或磁盘I/O控制器的数量以及磁盘的容量和速度是所以工作负荷的重要性能特征组件.还有其他应用程序自身的性能特征.工作负荷的特性.应用程序 ...

  6. python 数据分析 文章集锦

    文本分析: re&jieba模块  使用 正则表达式 和 中文处理模块jieba 原文地址:https://www.cnblogs.com/minutesheep/p/10357209.htm ...

  7. Shell基本知识

    Shell是什么 Shell是一个命令行解释器,它为用户提供了一个向Linux内核发送请求以便运行程序的界面系统级程序,用户可以使用Shell来启动.挂起.停止甚至编写一些程序. Shell还是一个功 ...

  8. PHP会话cookie类的封装

    <?php header('content-type:text/html;charset=utf-8');/** * 完成cookie的设置.删除.更新.读取 */class Cookie{   ...

  9. dedicated bearer

    Session Initiation Protocol (SIP) Basic Call Flow ExamplesRFC3665 intuitive,   done. PDF] TS 123 401 ...

  10. jquery ajax的getJSON使用

    getJSON的定义和用法 通过 HTTP GET 请求载入 JSON 数据. 在 jQuery 1.2 中,您可以通过使用 JSONP 形式的回调函数来加载其他网域的 JSON 数据,如 " ...