//数据源
string connString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=test)));Persist Security Info=True;User ID=test001;Password=test;";
OracleConnection conn = new OracleConnection(connString);//实例化
conn.Open();
Console.WriteLine("oracle 连接成功!");
//oracle数据库区分大小写,默认为大写,若表名中含小写字符,加引号才可以(视图也一样)
string sql = string.Format("select * from SCOTT.\"Bgkdatatest\"");
//string sql= string.Format("select * from SCOTT.BGK");
OracleCommand cmd = new OracleCommand(sql, conn);
DataTable dt = new DataTable();
OracleDataAdapter da = new OracleDataAdapter(cmd);
da.Fill(dt);
conn.Close();