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 ...
随机推荐
- 20155228 2016-2017-2《Java程序设计》课程总结
20155228 2016-2017-2<Java程序设计>课程总结 每周作业链接汇总 预备作业1 简要内容 了解「Trainer/Trainee」是最好的师生关系,对即将到来的翻转课堂有 ...
- Spring源码阅读(一)
Spring通过配置文件或者注解对类实例进行加载管理.稍微思考,可以猜测spring加载过程肯定先把配置转化为统一的配置对象,再把通过配置对象生产类实例.阅读源码,我们也可以发现这个逻辑. sprin ...
- DataBase(28)
1.数据库管理系统(DataBase Management System,DBMS):指一种操作和管理数据库的大型软件,用于建立.使用和维护数据库,对数据库进行统一管理和控制,以保证数据库的安全性和完 ...
- C#——WebApi 接口参数传参详解
本篇打算通过get.post.put.delete四种请求方式分别谈谈基础类型(包括int/string/datetime等).实体.数组等类型的参数如何传递. 一.get请求 对于取数据,我们使用最 ...
- jquery操作节点
var v= $("input[type='checkbox'][name='ids']:checked").closest('tr').find('td:eq(2)').map( ...
- 使用BenchmarkSQL测试PostgreSQL
BenchmarkSQL是一款经典的开源数据库测试工具,内嵌了TPCC测试脚本,可以对EnterpriseDB.PostgreSQL.MySQL.Oracle以及SQL Server等数据库直接进行测 ...
- Java Eclipse和MyEclipse快捷键
摘自:http://www.cnblogs.com/lsy131479/p/8487379.html 首先: 常用快捷键 alt+/ - - 万能快捷键 Ctrl+1 - - 快速修复 Eclip ...
- Docker学习笔记之Docker的Build 原理
0x00 概述 使用 Docker 时,最常用的命令无非是 docker container 和 docker image 相关的子命令,当然最初没有管理类命令(或者说分组)的时候,最常使用的命令也无 ...
- Prometheus监控学习笔记之Prometheus不完全避坑指南
0x00 概述 Prometheus 是一个开源监控系统,它本身已经成为了云原生中指标监控的事实标准,几乎所有 k8s 的核心组件以及其它云原生系统都以 Prometheus 的指标格式输出自己的运行 ...
- 深入理解Word2Vec
Word2Vec Tutorial - The Skip-Gram Model,Skip-Gram模型的实现原理:http://mccormickml.com/2016/04/19/word2vec- ...