首先下载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. django admin 处理文本换行空格

    使用 linebreaks filter <p>{{ blogpassage.content|linebreaksbr }}<p>

  2. ModuleNotFoundError: No module named '_pydevd_bundle.pydevd_cython' error on debug

    现象:pycharm调试代码出现错误:ModuleNotFoundError: No module named '_pydevd_bundle.pydevd_cython' error on debu ...

  3. Vue系列之 => 组件切换

    组件切换方式一 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  4. 输出列表为字符串,并在最后一个值前加上and 4.10.1

    逗号代码: def test4(lis): str1='' for i in range(len(lis)-1): str1+=(str(val[i])+', ') str1+=('and '+str ...

  5. CSS布局实战

    1. ul li中上图下字,图片.文字居中. <ul> <li> <img src="dash.png" style="display:bl ...

  6. 张春晖让视频的每词每句都可搜索:Autotiming 可以自动配字幕,还将改变哪些领域?

    张春晖让视频的每词每句都可搜索:Autotiming 可以自动配字幕,还将改变哪些领域? 对于一些电视观众来说,寻找电视节目字幕中“有趣”的Bug,拍照发到网上与其他人共同嘲笑一下,是一种观看节目之外 ...

  7. 校正PHP服务器时间不准的问题

    关于怎样解决PHP服务器时间不准的问题,得针对不同的情况进行不同的处理. 下面是经常遇到的情况,及应对办法. 1.PHP服务器时区不对,使用下面代码修正: <?php $timezone = & ...

  8. 蓝牙Profile的概念和常见种类(转)

    蓝牙Profile Bluetooth的一个很重要特性,就是所有的Bluetooth产品都无须实现全部 的Bluetooth规范.为了更容易的保持Bluetooth设备之间的兼容,Bluetooth规 ...

  9. 系统批量运维管理器Fabric详解

    系统批量运维管理器Fabric详解 Fabrici 是基于python现实的SSH命令行工具,简化了SSH的应用程序部署及系统管理任务,它提供了系统基础的操作组件,可以实现本地或远程shell命令,包 ...

  10. [转载]图解程序员必须掌握的Java常用8大排序算法

    这篇文章主要介绍了Java如何实现八个常用的排序算法:插入排序.冒泡排序.选择排序.希尔排序 .快速排序.归并排序.堆排序和LST基数排序,分享给大家一起学习. 分类1)插入排序(直接插入排序.希尔排 ...