用NuGet安装 Oracle ODP.NET

2024-04-28 09:36
文章标签 oracle 安装 net nuget odp

本文主要是介绍用NuGet安装 Oracle ODP.NET,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

oracle官网原文:Using NuGet to Install and Configure Oracle Data Provider for .NET

Using NuGet to Install and Configure Oracle Data Provider for .NET

In this section, you will install ODP.NET NuGet packages from nuget.org.

  1. Select View > Solution Explorer.

    NuGet

    Description of this image

  2. Right-click References in the Solution Explorer and choose Manage NuGet Packages.

    NuGet

    Description of this image

  3. In the NuGet Package Manager: NuGet window, select nuget.org in the Package Source. On the upper right side of the window, there is search bar. Search for Oracle. Select Official Oracle.ManagedDataAccess.EntityFramework driver in the search results and click Install.

    NuGet

    Description of this image


    Note: This step installs ODP.NET, Managed Entity Framework Driver and automatically pulls in any dependent assemblies, which include ODP.NET, Managed Driver and Entity Framework 6. These will be automatically downloaded and configured by the NuGet install package. In the screenshot, you can see that ODP.NET, Managed Driver and Oracle Providers for ASP.NET are available as standalone downloads.
  4. The Oracle and Entity Framework License Acceptance window appears. Click I Accept to accept the license terms for the packages. The ODP.NET, Managed Entity Framework Driver; ODP.NET, Managed Driver; and Entity Framework 6 will be downloaded, installed, and configured.

    NuGet

    Description of this image

  5. Observe the screen. In the NuGet Package Manager: NuGet window, you will now see green check mark icons next to ODP.NET, Managed Entity Framework Driver and ODP.NET, Managed Driver denoting they were installed. Click Close.

    NuGet

    Description of this image

  6. Expand References in the Solution Explorer window. Verify that ODP.NET and Entity Framework assemblies were added to the project.

    NuGet

    Description of this image

  7. Double click to open App.config in the Solution Explorer window.

    NuGet

    Description of this image

    Note: You will see that ODP.NET and Entity Framework configuration information has been added to the project. Managed ODP.NET does not require any Oracle Client installation.
  8. Observe the App.config file.

    NuGet

    Description of this image

 

Configuring NuGet ODP.NET

In this section, you will configure a database connection for your ODP.NET NuGet packages. The database server connection is specific to your application environment. A sample Oracle connect descriptor and connection string has been created. Add your deployment specific entries to connect to your Oracle database.

  1. In the App.config file, navigate to the <dataSource> element which has the attribute alias="SampleDataSource". Modify the HOSTPORT and SERVICE_NAME entries specific to your Oracle Database.

    NuGet

    Description of this image

    Note: You can also rename alias="SampleDataSource". Remember to specify this name for data source wherever you refer them.
  2. Navigate to the <add> element inside <connectionStrings> element. Modify the User IdPassword and Data Source entries. Note that the Data Source value should be the dataSource alias name you configured in the above step.

    NuGet

    Description of this image

    Your ODP.NET setup is now complete. You can develop and run any managed ODP.NET or Oracle Entity Framework 6 application.

这篇关于用NuGet安装 Oracle ODP.NET的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/942901

相关文章

python安装whl包并解决依赖关系的实现

《python安装whl包并解决依赖关系的实现》本文主要介绍了python安装whl包并解决依赖关系的实现,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录一、什么是whl文件?二、我们为什么需要使用whl文件来安装python库?三、我们应该去哪儿下

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL9.0默认路径安装下重置root密码

《MySQL9.0默认路径安装下重置root密码》本文主要介绍了MySQL9.0默认路径安装下重置root密码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录问题描述环境描述解决方法正常模式下修改密码报错原因问题描述mysqlChina编程采用默认安装路径,

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

oracle DBMS_SQL.PARSE的使用方法和示例

《oracleDBMS_SQL.PARSE的使用方法和示例》DBMS_SQL是Oracle数据库中的一个强大包,用于动态构建和执行SQL语句,DBMS_SQL.PARSE过程解析SQL语句或PL/S... 目录语法示例注意事项DBMS_SQL 是 oracle 数据库中的一个强大包,它允许动态地构建和执行

Python安装时常见报错以及解决方案

《Python安装时常见报错以及解决方案》:本文主要介绍在安装Python、配置环境变量、使用pip以及运行Python脚本时常见的错误及其解决方案,文中介绍的非常详细,需要的朋友可以参考下... 目录一、安装 python 时常见报错及解决方案(一)安装包下载失败(二)权限不足二、配置环境变量时常见报错及

PLsql Oracle 下载安装图文过程详解

《PLsqlOracle下载安装图文过程详解》PL/SQLDeveloper是一款用于开发Oracle数据库的集成开发环境,可以通过官网下载安装配置,并通过配置tnsnames.ora文件及环境变... 目录一、PL/SQL Developer 简介二、PL/SQL Developer 安装及配置详解1.下

MySQL8.2.0安装教程分享

《MySQL8.2.0安装教程分享》这篇文章详细介绍了如何在Windows系统上安装MySQL数据库软件,包括下载、安装、配置和设置环境变量的步骤... 目录mysql的安装图文1.python访问网址2javascript.点击3.进入Downloads向下滑动4.选择Community Server5.

CentOS系统Maven安装教程分享

《CentOS系统Maven安装教程分享》本文介绍了如何在CentOS系统中安装Maven,并提供了一个简单的实际应用案例,安装Maven需要先安装Java和设置环境变量,Maven可以自动管理项目的... 目录准备工作下载并安装Maven常见问题及解决方法实际应用案例总结Maven是一个流行的项目管理工具

MySql9.1.0安装详细教程(最新推荐)

《MySql9.1.0安装详细教程(最新推荐)》MySQL是一个流行的关系型数据库管理系统,支持多线程和多种数据库连接途径,能够处理上千万条记录的大型数据库,本文介绍MySql9.1.0安装详细教程,... 目录mysql介绍:一、下载 Mysql 安装文件二、Mysql 安装教程三、环境配置1.右击此电脑