Hi guys,
Can you please help me I need to create a application iboutn VS.Net 2008(C#) and connect it to an oracle database can anyone please help on how to go about calling oracle store procedure with parameters from my application(just a basic sample the rest I will do my self)
thanks
Bechir BejaouiPosted Feb 19, 2009, 6:32 PM
http://www.oracle.com/technology/software/tech/dotnet/odt_index.html
Afterward you reference the namespace
Oracle.DataAccess.Client;
Then I suppose that you connect with SCOTT as ID and TIGER as password, for the server I can suggest to test msdora or try it any way if you have the server name then OK
OracleConnection conn = new OracleConnection(
"Persist Security Info=False;User ID=SCOTT;Password=TIGER;Data Source=MYSERVER;");
OracleCommand cmd = new OracleCommand("ProcedureName",conn);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter param1 = new OracleParameter("paramNameInThe StoredProcedure",OracleDbType.
prm1.Direction = ParameterDirection.;
prm1.Value = value1;
cmd.Parameters.Add(
.
.
.
OracleParameter paramN = new OracleParameter("paramNameInThe StoredProcedure",OracleDbType.
prm1.Direction = ParameterDirection.;
prm1.Value = valueN;
cmd.Parameters.Add(
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();