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 

  • 相关阅读:
    探讨e.target与e.currentTarget
    JavaScript事件模型
    博客
    angular创建自定义指令的四种方式
    jqueryMobile模块整理—图标(icons)
    jqueryMobile模块整理—按钮(buttons)
    Visio 2010,如何打开多个窗口
    Ajax.ActionLink浏览器中代码解析问题
    响应式布局
    jquery的each
  • 原文地址:https://www.cnblogs.com/tuolin/p/1789282.html
Copyright © 2011-2022 走看看