zoukankan      html  css  js  c++  java
  • ODP.NET数据访问

    step1 download ODTwithODAC1110621;

    step2 add ref Oracle.DataAccess;

    step3 copy following code ;

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace DAL
    {
        public class TestOrclODP
        {

            public static  List<string> LoadDataODP()
            {
                string oradb = "Data Source=TUO;user id=system;password=tuo";

                OracleConnection conn = new OracleConnection(oradb);
                conn.Open();
                string sql = "select TOPIC,SEQ,INFO from SYSTEM.HELP";
                OracleCommand cmd = new OracleCommand(sql,conn);
                OracleDataReader rdr = cmd.ExecuteReader();
                List<string> rtnList = new List<string>();
                while(rdr.Read()){
                    rtnList.Add(rdr["INFO"].ToString());
                }
                return rtnList;
            }
        }
    }

    step4 copy E:\app\Administrator\product\11.1.0\db_1\NETWORK\ADMIN 下sqlnet.ora和tnsnames.ora

    TO  E:\app\Administrator\product\11.1.0\client_2\Network\Admin 

  • 相关阅读:
    局域网 标准
    协议的构成
    耦合
    theano中tensor的构造方法
    Mac下安装OpenCV3.0和Anaconda和环境变量设置
    【数据源】24万数据集:社会发展类公开数据清单
    Windows Thin PC(7月2日发布)下载+激活+汉化
    CNN笔记
    Python 爬虫的工具列表
    test image
  • 原文地址:https://www.cnblogs.com/tuolin/p/1789282.html
Copyright © 2011-2022 走看看