c# 之 Microsoft.Practices.EnterpriseLibrary连接Oracle
首先下载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的更多相关文章
- Microsoft.Practices.EnterpriseLibrary.Logging的使用
翻译 原文地址:http://www.devx.com/dotnet/Article/36184/0/page/1 原文作者:Thiru Thangarathinam (好强大的名字) 翻译: fl ...
- Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, ...
使用oracle数据库一个多月依赖这问题一直都得不到解决,最近任务不是很忙了,所以决定把这问题解决掉.写一篇文章做记录. 以上错误主要是net程序oracle数据库使用了Microsoft Enter ...
- 缓存篇~第六回 Microsoft.Practices.EnterpriseLibrary.Caching实现基于方法签名的数据集缓存
返回目录 这一讲中主要是说EnterpriseLibrary企业级架构里的caching组件,它主要实现了项目缓存功能,它支持四种持久化方式,内存,文件,数据库和自定义,对于持久化不是今天讨论的重要, ...
- 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching,
问题: 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching ...
- Microsoft.Practices.EnterpriseLibrary企业库问题
System.Configuration.ConfigurationErrorsException: Invalid TraceListenerData type in configuration ' ...
- Microsoft.Practices.EnterpriseLibrary
项目中使用了Microsoft.Practices.EnterpriseLibrary这个东西,根据名字猜测和微软有关系(可以翻译为:微软实践企业库). 看到了引入了两个命名空间: using Mic ...
- 在WebService中使用Microsoft.Practices.EnterpriseLibrary.Data配置数据库
1. 新建WebApplication1项目 1.1 新建—Web—ASP.NET Empty Web Application--WebApplication1 1.2 添加一个WebForm1 2. ...
- VS - Microsoft.Practices.EnterpriseLibrary.Logging
string fileName = AppDomain.CurrentDomain.BaseDirectory + "\\log.txt";File.AppendAllText(f ...
- 使用EnterpriseLibrary插入Oracle CLOB数据
转自:http://www.programgo.com/article/20022195177/ http://blog.csdn.net/ddxkjddx/article/details ...
随机推荐
- Qt5 信号重载
下面以最常用的QComboBox为例说明. [1]Qt4风格的connect 示例代码: connect(ui->comboBox, SIGNAL(activated(int index)), ...
- linux帮助
不知道的指令但是你想要了解:man 指令 如果知道某一个指令忘记相关参数:在指令后接 -- help 忘记指令: 两个tab
- C# 调整控件的Z顺序
当窗口或者容器控件中的控件在布局过程中发生重叠的时候,会出现层次性.Z顺序较大的控件会遮挡Z顺序较小的控件,放在顶层的控件会挡住放在底层的控件. 1.编辑一个这样的窗口(使用Label控件) 2.添加 ...
- Shell for while 循环
li@ubuntu:~/test$ cat a.sh #!/bin/bash for loop in 1 2 3 4 5 do echo "The value is : $loop" ...
- 怎样从外网访问内网WebLogic?
本地安装了一个WebLogic,只能在局域网内访问,怎样从外网也能访问到本地的WebLogic呢?本文将介绍具体的实现步骤. 准备工作 安装并启动WebLogic 默认安装的WebLogic端口是70 ...
- xml文件中[Invalid byte 1 of 1-byte UTF-8 sequence.]的解决方案
问题描述: 导入项目包后发生xml文件出现错误信息:[Invalid byte 1 of 1-byte UTF-8 sequence.],如下截图所示: 解决方案: 将xml文件全部内容剪切到Note ...
- WINDOW 安装ImageMagick服务端和PHP的imagick插件
写在最前: windows下要注意的就是ImageMagick版本要与php扩展的Imagick能对应上,同时Imagick版本的选择也要与服务器环境以及php的情况对应上,不然就容易安装失败,我就是 ...
- Spring Boot 2 (三):Spring Boot 2 相关开源软件
Spring Boot 2 (三):Spring Boot 2 相关开源软件 一.awesome-spring-boot Spring Boot 中文索引,这是一个专门收集 Spring Boot 相 ...
- jackson/fastjson、mybatis、mysql date/datatime/timestamp、java Date/Timestamp关系详解
jackson/fastjson序列化/反序列化: 默认情况下,jackson/fastjson将java Date/Timestamp类型序列化为时间戳,也就是1970年1月1日0点以来的毫秒数.如 ...
- MobaXterm setting autocomplete
autocomplete-server-names-for-ssh-and-scp mkdir /etc/bash_completion.d cat >> /etc/bash_comple ...