庹庹

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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 

posted on 2010-07-31 12:04  庹林  阅读(284)  评论(0编辑  收藏  举报