Last post Apr 30, 2011 07:34 AM by KumarHarsh
Apr 23, 2011 09:25 AM|tj_love|LINK
I am developing a GUI of Oracle and for that i am using front end as c# asp.net and backend as Oracle database of connectivity of these two i am using OleDb connection.
I want to show data from table in gridview. for that my code is as follow:
con1 = new OleDbConnection();
con1.ConnectionString = "Provider=\"OraOLEDB.Oracle.1\";User ID=" + user.ToString() + ";Password=" + pass.ToString() + ";Source=odbcName;Extended Properties=\"\";Persist Security Info=False";
string sql1 = "select * from " + ddl_select_table.SelectedItem.Text;
cmd1 = new OleDbCommand(sql1, con1);
OleDbDataReader odr = cmd1.ExecuteReader();
GridView1.DataSource = odr;
data reader contains data of the table but i cnt see data in grid view.
Please help me for this error!!
Thanks and regards in advance.
Apr 25, 2011 02:32 PM|Lannie|LINK
Use Oracle ODAC (ODP.NET)
faster and more features than OLEDB
Apr 30, 2011 07:34 AM|KumarHarsh|LINK
populate dataset with same query then
GridView1.DataSource = ds.Table;