How can i call oracle 10g view from asp.net page?
View "DEPARTMENTS_VIEW" is
select Department_ID, DEPARTMEN_NAME , DISCOUNT from DEPARTMENTS
c# code is
OracleConnection conn = new OracleConnection();
conn.ConnectionString = txtconnection.Text;
conn.Open();
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = conn;
objCmd.CommandType = CommandType.StoredProcedure;
objCmd.CommandText = "DEPARTMENTS_VIEW";
DataSet ds = new DataSet();
OracleDataAdapter oraDa = new OracleDataAdapter(objCmd);
oraDa.Fill(ds, "department");
gvGET_DEPARTMENTS.DataSource = ds.Tables["department"];
gvGET_DEPARTMENTS.DataBind();
conn.Close();
I'm getting this error code:
ORA-06550: line 1, column 7:
PLS-00221: 'DEPARTMENTS_VIEW' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored