用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使用国内镜像加速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.右击此电脑

oracle如何连接登陆SYS账号

《oracle如何连接登陆SYS账号》在Navicat12中连接Oracle11g的SYS用户时,如果设置了新密码但连接失败,可能是因为需要以SYSDBA或SYSOPER角色连接,解决方法是确保在连接... 目录oracle连接登陆NmOtMSYS账号工具问题解决SYS用户总结oracle连接登陆SYS账号

Oracle数据库如何切换登录用户(system和sys)

《Oracle数据库如何切换登录用户(system和sys)》文章介绍了如何使用SQL*Plus工具登录Oracle数据库的system用户,包括打开登录入口、输入用户名和口令、以及切换到sys用户的... 目录打开登录入口登录system用户总结打开登录入口win+R打开运行对话框,输php入:sqlp

在 Windows 上安装 DeepSeek 的完整指南(最新推荐)

《在Windows上安装DeepSeek的完整指南(最新推荐)》在Windows上安装DeepSeek的完整指南,包括下载和安装Ollama、下载DeepSeekRXNUMX模型、运行Deep... 目录在www.chinasem.cn Windows 上安装 DeepSeek 的完整指南步骤 1:下载并安装