Namespaces:
using System.Web.Configuration;
using System.Data.OracleClient;
using System.Data;
string cs = WebConfigurationManager.ConnectionStrings["SomeConnectionString"].ConnectionString;
using (OracleConnection oc = new OracleConnection(cs))
{
oc.Open();
DataTable dt = new DataTable();
OracleCommand ocmd = new OracleCommand("SELECT * FROM SOMETABLE", oc);
OracleDataAdapter oda = new OracleDataAdapter(ocmd);
oda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
No comments:
Post a Comment