1.引入OracleClient,安装Oracle后添加引用
using System.Data.OracleClient;
2.
//User Id为用户名,Password为密码,数据名为First
OracleConnection conn = new OracleConnection("User Id=system;Password=sa;Data Source=First");
conn.Open();
OracleDataAdapter oda = new OracleDataAdapter("select * from SH.TIMES", conn);
DataSet ds = new DataSet();
oda.Fill(ds);
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.GridView1.DataBind();
conn.Close();