probl accesing oracle view and bind it to datagrid
i have made views in oracle and the viewname = V_SUTR_PDPJ;when i acces the view with OracleDataadapter.fill methode, error occur. here's the error message "ora-02041 client database did not begin a transaction",
and here's the code i wrote;
protected virtual DataTable GetDatatable(string NameOfStoredProcedure, string Sql,string DataTableName) // methode for accesing datatable
{
this.GetConnection();// methode to build a new connection
if (NameOfStoredProcedure != "")
{
this.OraComm = new OracleCommand(NameOfStoredProcedure, this.OraConn);// oraconn = field / property for OracleConnection
this.OraComm.CommandType = CommandType.StoredProcedure;
}
else
{this.OraComm = new OracleCommand(Sql, this.OraConn);
this.OraComm.CommandType = CommandType.Text;
}
DataTable myDataTable = new DataTable(DataTableName);
myDataTable.Clear();
this.OraDat = new OracleDataAdapter(this.OraComm);
this.OraDat.Fill(myDataTable);//exception(error here)at debuging
//this.OraComb = new OracleCommandBuilder(this.OraDat);
this.CloseConnection();// close the connection after filling
return myDataTable;
}
if there's someone who knows the matter, please reply this topic
i'll be waiting for the answer.
|