连接C#到Oracle [英] Connecting C# to Oracle

查看:194
本文介绍了连接C#到Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的库/驱动器到C#(.NET)应用程序连接到Oracle 10g和11g

目前的期权,我发现是:

What is the best library/driver to connect C# (.NET) application to Oracle 10g and 11g.
Current options that I found are:


  1. Oracle客户端自带的数据库安装

  2. Oracle即时客户端(这是一个有点混乱,因为它有6-8个版本的操作系统的数量)

  3. 微软ODBC? (这能使用吗?)

  4. ODP.Net - 这是独立的产品或者是包含在1和2。

  1. Oracle client that comes with database installation
  2. Oracle Instant Client (which is a bit confusing since it has 6-8 versions for number of operating systems)
  3. Microsoft ODBC ? (Can this be used?)
  4. ODP.Net - is this separate product or is it included in 1. and 2. ?

有人能解释差异?

我打算C#应用程序,将做Oracle数据库的基本CRUD操作。哪个库/驱动器是体积最小,最简单的安装?

I am planning C# application that will do basic CRUD operations on Oracle database. Which library/driver is smallest and easiest to install?

编辑:

一般建议是使用ODP.Net。现在,可有人请解释或指向回答有关安装软件包的客户端之间的差异。我发现了3种不同的客户的Oracle 11g:


General recommendation is to use ODP.Net. Now, can somebody please explain or point to answer about differences between client install packages. I found 3 different clients for Oracle 11g:

  • Oracle client - client drivers package that ships as part of database installation
  • ODAC - Oracle data access components, contains lots of things, among them are ODP.Net and Oracle Instant Client
  • Oracle Instant Client which also contains many things, including ODP.Net

那么,其中哪些是够发展? Oracle文档是痛苦详细,但没有对这些客户端软件包之间的差异说。我会用最小的(即时客户端)去。它是最好的选择。

So, which of those is enough for development? Oracle documentation is painfully detailed, but says nothing about differences between those client packages. I would go with smallest (Instant Client). Is it best choice?

编辑2:

我使用.net 3.5

Edit 2:
I am using .Net 3.5

推荐答案

要C#连接Oracle您需要.NET数据提供程序。这可以是下列之一:

To connect C# to oracle you need a data provider for .net. This can be one of the following:


  • ODP.Net(甲骨文)

  • System.Data这.OracleClient(微软)

  • ODBC(甲骨文)

  • OLEDB(甲骨文)

  • ADO.NET的DataDirect甲骨文(DataDirect的)

  • 数据提供者可能是一些其他的提供商

  • ODP.Net (Oracle)
  • System.Data.OracleClient (Microsoft)
  • ODBC (Oracle)
  • OLEDB (Oracle)
  • DataDirect ADO.NET Data Provider for Oracle (DataDirect)
  • may be some other provider

全部这个数据提供需要安装Oracle客户端。没有独立的库jdbc14.jar在java中。你有两个选择部署Oracle客户端:

All of this data provider need an oracle client installed. There is no standalone library as jdbc14.jar as in java. You have 2 choices deploying an oracle client:


  • 完整的客户端(可以是来自数据库安装)

  • 即时客户端

ODP.Net,ODBC,OLEDB是完整的客户端的一部分。这是硬的方式,因为在安装过程中必须在每台客户端乳宁软件上运行。这是最兆字节被放置在客户机上结果,
中的即时客户是在不同的软件包提供。这是一个Oracle客户端部署最小的方式。

ODP.Net, ODBC, OLEDB are part of full client. This is the "hard" way because an installation process must be run on every client runing your software. This is where the most megabytes are put on the client.
The instant client is provided in different packages. This is the smallest way for deployment of an oracle client.

我会建议使用ODP.Net与Oracle即时客户端,因为这很容易,部署和重量非常非常轻

I would suggest using ODP.Net with Oracle Instant Client, because this easy to deploy and very very light weight.

即时客户端软件包,您需要哪:

Which instant client packages do you need:


    < (其中设置ODAC或更新版本)LI>选择版本11.1.0.6.0
  • 即时客户端软件包 - 基本(如果你需要完整的语言支持)

  • 即时客户端软件包 - ODAC

有很多的关于使用C#应用程序Oracle即时客户端的部署计算器文章

There are a lot of articles on stackoverflow about deployment of oracle instant client with c# applications.

编辑:的更新的链接和版本

这篇关于连接C#到Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆