Ado.net executes the Oracle stored procedures as follows:
OracleConnection con=new OracleConnection (Strcon);
OracleCommand cmd=new OracleCommand ();
OracleTransaction Mytrans;
Try
{
Con. Open ();
Mytrans =con. BeginTransaction ();
Cmd. Connection =con;
Cmd.commandtext = "Rfgetid";
Cmd.commandtype =commandtype. StoredProcedure;
Cmd. Transaction =mytrans;
OracleParameter parameter_in=new OracleParameter ("AS_BM", Oracletype.char);
OracleParameter parameter_out=new OracleParameter ("As_sxh", OracleType. number);
Parameter_in. Direction =parameterdirection. Input;
Parameter_out. Direction=parameterdirection. Output;
Parameter_in. Value =tblname. ToUpper ();
Cmd. Parameters. ADD (parameter_in);
Cmd. Parameters.Add (parameter_out);
Cmd. ExecuteNonQuery ();
Mytrans. Commit ();
return int. Parse (parameter_out. Value.tostring ());
}
catch (Exception er)
{
throw new Exception (Er. message);
Mytrans. Rollback ();
}
Finally
{
Cmd. Dispose ();
Con. Close ();
}