System.Data.OracleClient.dll方式操作oracle数据库

一.查询语句:

 using (OracleConnection conn = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["local_Orcl"].ConnectionString))
{
conn.Open();
using (OracleCommand cmd = conn.CreateCommand())
{
try
{
cmd.CommandText = "select * from HLB_HIS_REQUISITION";
DataTable dt = null;
OracleDataAdapter adapter = new OracleDataAdapter();
adapter.SelectCommand = cmd;
dt = new DataTable();
adapter.Fill(dt);
cmd.Parameters.Clear(); dataGridView1.DataSource = dt;
}
catch (Exception ee)
{
MessageBox.Show(ee.Message.ToString() + "\r\n" + ee.StackTrace.ToString());
cmd.Dispose();
conn.Close();
conn.Dispose();
}
}
}

二.插入语句:

 using (OracleConnection conn = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["local_Orcl"].ConnectionString))
{
conn.Open();
using (OracleCommand cmd = conn.CreateCommand())
{
try
{
cmd.CommandText = "insert into hlb_his_requisition(requisition_id, patient_name, patient_sex, patient_age, patient_bed, charge_name, sample_class, requisition_state)values(1,'张三', 1, 1, 1, 1, 1, 1)";
cmd.ExecuteNonQuery();
}
catch (Exception ee)
{
MessageBox.Show(ee.Message.ToString() + "\r\n" + ee.StackTrace.ToString());
cmd.Dispose();
conn.Close();
conn.Dispose();
}
}
}

三.连接字符串:

<add name="local_Orcl" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.31.11)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User ID=scott;Password=123"/>

四.是否乱码:

五.是否需要安装客户端:

System.Data.OracleClient.dll方式操作oracle数据库的更多相关文章

  1. Oracle.DataAccess.dll方式操作oracle数据库

    Oracle.DataAccess.dll方式操作oracle数据库 一.查询语句: using (OracleConnection conn = new OracleConnection(Syste ...

  2. Oracle.ManagedDataAccess.dll方式操作oracle数据库

    Oracle.ManagedDataAccess.dll方式操作oracle数据库 一.查询语句: using (OracleConnection conn = new OracleConnectio ...

  3. (转) C#使用ODP.NET(Oracle.ManagedDataAccess.dll)操作Oracle数据库

    原贴链接:https://www.cnblogs.com/mq0036/p/11052359.html C#使用ODP.NET(Oracle.ManagedDataAccess.dll)操作Oracl ...

  4. OLEDB方式操作oracle数据库

    OLEDB方式操作oracle数据库 一.查询语句: using (OleDbConnection conn = new OleDbConnection(System.Configuration.Co ...

  5. ODBC方式操作oracle数据库

    ODBC方式操作oracle数据库 一.查询语句: var strConn = System.Configuration.ConfigurationManager.ConnectionStrings[ ...

  6. C#使用ODP.NET(Oracle.ManagedDataAccess.dll)操作Oracle数据库

    在刚接触C#的时候由于公司使用的就是Oracle数据库,那么C#怎么连接Oracle数据库就成了首要去掌握的知识点了.在那时没有ODP.NET,但visual studio却对Oralce数据库的调用 ...

  7. C#连接Oracle数据库的方法(System.Data.OracleClient、Oracle.DataAccess.Client也叫ODP.net、Oracle.ManagedDataAccess.dll)

    官方下载地址(ODP.net)(中文):http://www.oracle.com/technetwork/cn/topics/dotnet/downloads/index.html 官方下载地址(O ...

  8. C# VS2010中,用微软自带的System.Data.OracleClient来连接Oracle数据库

    由于微软在.Net框架4.0中已经决定撤销使用System.Data.OracleClient,造成在VS2010中无法连接Oracle数据库,但它还依旧存在于.Net架构中,我们可以通过自己引用 C ...

  9. csharp: ODP.NET,System.Data.OracleClient(.net 4.0) and System.Data.OleDb读取Oracle g 11.2.0的区别

    ODP.NET: 引用: using Oracle.DataAccess; //Oracle g 11.2.0 using Oracle.DataAccess.Client; using Oracle ...

随机推荐

  1. node / npm 配置问题

    安装nodejs 后运行 npm 命令无响应处理方法 安装和卸载过nodejs, 也编辑过 C:\Users\{账户}\下的.npmrc文件. 再全新安装nodejs ,运行npm 命令,无响应. 处 ...

  2. quartz的配置文件

    quartz在运行时默认加载的是工程目录下的quartz.properties文件,如果工程目录下没有quartz.properties文件,它就会去读取quartz jar包下的quartz.pro ...

  3. beego 中文教程

    https://www.kancloud.cn/hello123/beego/126087

  4. Render Texture

    [Render Texture] Render Textures are special types of Textures that are created and updated at runti ...

  5. SaltStack 运行机理特点

    SaltStack 运行机理特点 1.实时通讯(REAL-TIME COMMUNICATION) 所有 Salt minions 接收命令都是同时的,这意味着控制 10 个或者 10000 个系统所消 ...

  6. 解决"authentication token manipulation error"

      昨天安装是Ubuntu Server. 配置好了几个软件后就忘记继续了...今天打开,居然忘记了密码...真是的..  后来还是要改了. 不想重新弄什么的了..百度了下怎么改密码...然后就有一篇 ...

  7. 346. Moving Average from Data Stream数据窗口流中位数的数据结构设计

    [抄题]: Given a stream of integers and a window size, calculate the moving average of all integers in ...

  8. 系统性能信息模块之psutil模块

    一.psutil模块介绍 官方网址:https://pypi.org/ psutil模块安装:https://github.com/giampaolo/psutil/blob/master/INSTA ...

  9. Part3_lesson2---ARM指令分类学习

    1.算术和逻辑指令 mov.mvn.cmp.tst.sub.add.and.bic 2.比较指令 cmp和tst 3.跳转指令 b和bl 4.移位指令 lsl和ror 5.程序状态字访问指令 msr与 ...

  10. TF Boys (TensorFlow Boys ) 养成记(四):TensorFlow 简易 CIFAR10 分类网络

    前面基本上把 TensorFlow 的在图像处理上的基础知识介绍完了,下面我们就用 TensorFlow 来搭建一个分类 cifar10 的神经网络. 首先准备数据: cifar10 的数据集共有 6 ...