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 ...
随机推荐
- Windows10上安装Keras 和 TensorFlow-GPU
安装环境: Windows 10 64bit GPU: GeForce gt 720 Python: 3.5.3 CUDA: 8 首先下载Anaconda3的Win10 64bit版,安装Python ...
- Java多线程-----原子变量和CAS算法
原子变量 原子变量保证了该变量的所有操作都是原子的,不会因为多线程的同时访问而导致脏数据的读取问题 Java给我们提供了以下几种原子类型: AtomicInteger和Ato ...
- 更换tomcat运行日志目录
1.在tomcat安装文件夹的bin目录下,修改catalina.sh,改变catalina.out的输出目录 CATALINA_OUT="$CATALINA_BASE"/logs ...
- Redis入门——Java接口
1. maven配置 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis&l ...
- 接口作为方法的参数或返回值——List接口
接口作为方法的参数或返回值,源码可知,List为一个接口,ArraryList是的它的实现类: 其中,addNames方法中,入参和返回值都List接口,入参是多态的,编译看左,运行看右(访问成员方法 ...
- c# 继承与多种状态
可访问性: public 无限制 internal 只允许在同一个程序集访问 protected ...
- Spring boot 问题总结
1. Spring boot 嵌入的tomcat不能启动: Unregistering JMX-exposed beans on shutdown 在官网(http://start.spring. ...
- js 简易年历
html部分 <div class='calendar'> <div class="tabBox" id='nav' > <ul> <li ...
- 怎样从外网访问内网RESTful API?
本地部署了RESTful API,只能在局域网内访问,怎样从外网也能访问到本地的RESTful API呢?本文将介绍具体的实现步骤. 准备工作 部署并启动RESTful API服务端 默认部署的RES ...
- \r\n回车换行\r回车\n换行的区别
在计算机还没有出现之前,有一种叫做电传打字机(Teletype Model 33,Linux/Unix下的tty概念也来自于此)的玩意,每秒钟可以打10个字符.但是它有一个问题,就是打完一行换行的时候 ...