首先下载Microsoft Enterprise Library 5.0:http://www.microsoft.com/en-us/download/details.aspx?id=15104,
这是一个安装包Enterprise Library 5.0.msi,选择目录后安装。
1、引用dll 在安装位置的的文件中  或者  直接下载dll文件引用也可以

2、在配置文件中配置节点

<configuration>
<!--若是对于大型的网络而言,可能需要另外一种配置,那么安装包就需要全部选中安装,而不是三个dll-->
<configSections>
<!--添加自定义节点 企业库的配置 注意:configSections 必须时configuration下的第一个子节点-->
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> <dataConfiguration defaultDatabase="ceshi"/>
<connectionStrings>
<add name="ceshi" connectionString="Data Source=orcl;User ID=ehospitalII;password=yygl;Unicode=True" providerName="System.Data.OracleClient"/>
</connectionStrings>
</configuration>

3、后台简单获取数据

static void Main(string[] args)
{
string sql = "select * from RSGL_ZGDA";
Database l_db;
l_db = DatabaseFactory.CreateDatabase();
//DbConnection conn = l_db.CreateConnection();
//conn.Open();
// DbTransaction l_trans = conn.BeginTransaction();
DbCommand cmd = l_db.GetSqlStringCommand(sql);
DataSet ds = l_db.ExecuteDataSet(cmd);
}

参考来源:http://blog.csdn.net/yysyangyangyangshan/article/details/8488791

c# 之 Microsoft.Practices.EnterpriseLibrary连接Oracle的更多相关文章

  1. Microsoft.Practices.EnterpriseLibrary.Logging的使用

    翻译 原文地址:http://www.devx.com/dotnet/Article/36184/0/page/1  原文作者:Thiru Thangarathinam (好强大的名字) 翻译: fl ...

  2. Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, ...

    使用oracle数据库一个多月依赖这问题一直都得不到解决,最近任务不是很忙了,所以决定把这问题解决掉.写一篇文章做记录. 以上错误主要是net程序oracle数据库使用了Microsoft Enter ...

  3. 缓存篇~第六回 Microsoft.Practices.EnterpriseLibrary.Caching实现基于方法签名的数据集缓存

    返回目录 这一讲中主要是说EnterpriseLibrary企业级架构里的caching组件,它主要实现了项目缓存功能,它支持四种持久化方式,内存,文件,数据库和自定义,对于持久化不是今天讨论的重要, ...

  4. 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching,

    问题: 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching ...

  5. Microsoft.Practices.EnterpriseLibrary企业库问题

    System.Configuration.ConfigurationErrorsException: Invalid TraceListenerData type in configuration ' ...

  6. Microsoft.Practices.EnterpriseLibrary

    项目中使用了Microsoft.Practices.EnterpriseLibrary这个东西,根据名字猜测和微软有关系(可以翻译为:微软实践企业库). 看到了引入了两个命名空间: using Mic ...

  7. 在WebService中使用Microsoft.Practices.EnterpriseLibrary.Data配置数据库

    1. 新建WebApplication1项目 1.1 新建—Web—ASP.NET Empty Web Application--WebApplication1 1.2 添加一个WebForm1 2. ...

  8. VS - Microsoft.Practices.EnterpriseLibrary.Logging

    string fileName = AppDomain.CurrentDomain.BaseDirectory + "\\log.txt";File.AppendAllText(f ...

  9. 使用EnterpriseLibrary插入Oracle CLOB数据

    转自:http://www.programgo.com/article/20022195177/       http://blog.csdn.net/ddxkjddx/article/details ...

随机推荐

  1. 4.GDscript(2)关键字,运算符,字面量

    (来源godot官方文档) 关键词 下面是该语言支持的关键字列表.由于关键字是保留字(令牌),它们不能用作标识符.操作符(如 in , not , and 或 or )以及下面列出的内置类型的名称也是 ...

  2. javascript(一):javascript基本介绍及基本语法

    什么是javascript? javascript是一种直译型脚本语言,是一种动态类型.弱类型.基于原型的语言.(所谓“脚本语言”:指的是它不具有开发操作系统的能力,只是用来编写大型运用程序的脚本!) ...

  3. uva 11183 Teen Girl Squad

    题意: 有一个女孩,需要打电话让所有的人知道一个消息,消息可以被每一个知道消息的人传递. 打电话的关系是单向的,每一次电话需要一定的花费. 求出打电话最少的花费或者判断不可能让所有人知道消息. 思路: ...

  4. STL容器之vector

    [1]模板类vector 模板类vector可理解为广义数组.广义数组,即与类型无关的数组,具有与数组相同的所有操作. 那么,你或许要问:既然C++语言本身已提供了一个序列式容器array,为什么还要 ...

  5. MapReduce的map个数调节 与 Hadoop的FileInputFormat的任务切分原理

    在对日志等大表数据进行处理的时候需要人为地设置任务的map数,防止因map数过小导致集群资源被耗光.可根据大表的数据量大小设置每个split的大小. 例如设置每个split为500M: set map ...

  6. Numpy 矩阵

    矩阵定义在NumPy中,矩阵是ndarray的子类,可以由专用的字符串格式来创建 1. 创建矩阵mat函数创建矩阵(mat函数创建矩阵时,若输入已为matrix或ndarray对象,则不会为它们创建副 ...

  7. 安装mysql警告 warning: mysql-community-server-5.7.19-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    摘自:https://www.cnblogs.com/royfans/p/7243641.html 红帽安装rpm安装MySQL时爆出警告: 警告:MySQL-server-5.5.46-1.linu ...

  8. 我是这样手写 Spring 的(麻雀虽小五脏俱全)

    人见人爱的 Spring 已然不仅仅只是一个框架了.如今,Spring 已然成为了一个生态.但深入了解 Spring 的却寥寥无几.这里,我带大家一起来看看,我是如何手写 Spring 的.我将结合对 ...

  9. How many zero's and how many digits ? UVA - 10061

    Given a decimal integer number you will have to find out how many trailing zeros will be there in it ...

  10. selenium webdriver 实现Canvas画布自动化测试

    https://blog.csdn.net/xiaoguanyusb/article/details/80324210 由借鉴意义, 转过来 canvas 是一个画布,定位元素时只能定位到画布上,如下 ...