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