oracle

Mar 25 2009 5:04 AM

hi guys please help me m trying to call a stored  procedure from a oracle database below is my code 

string sSql = string.Empty;

sSql = "SP_ReturnHosts";

OracleCommand sel = new OracleCommand(sSql, g_conn);

sel.CommandType = CommandType.StoredProcedure;

sel.Parameters.Add("cursor_res", OracleType.Cursor).Direction=ParameterDirection.Output;

OracleDataAdapter da = new OracleDataAdapter();

DataSet ds = new DataSet();

g_conn.Open();

a.SelectCommand = sel;

da.Fill(ds);

o_dt = ds.Tables[0];

g_conn.Close();

all I need to know is if there is a way of doing this in a better way without using both oracle command and DataAdapter(like in ms sql sever where you just use dataadapter only),

Thanks


Answers (2)