2
Answers

oracle

Phakamani  Blose

Phakamani Blose

16y
2.6k
1

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)
0
Jignesh Trivedi

Jignesh Trivedi

NA 61k 14.2m 12y
hi,

your quesion is not too much clear....

correct me! from frend end you have dept name, emp name and you want to add record in emp Master.

so first of all get dept id from deptMaster table from dept name

select deptId from deptName = @deptName.

now insert record in empMaster.

hope this will help you.