Greetings, as the title says, How to call an **Oracle **Stored Procedure and pass parameters to it?
Here's what I have so far:
Lets say I have a stored procedure called CUSTOMER_INFO
which has 3 INput parameters and returns an OUTput value.
DataSet ds = new DataSet();
SqlParameter[] parameters = new SqlParameter[3];
parameters[0] = new SqlParameter("@inParameter1", SqlDbType.Decimal, 0, ParameterDirection.Input, true, 18, 0, "", DataRowVersion.Current, Parameter1);
parameters[1] = new SqlParameter("@inParameter2", SqlDbType.Decimal, 0, ParameterDirection.Input, true, 18, 0, "", DataRowVersion.Current, Parameter2);
parameters[2] = new SqlParameter("@inParameter3", SqlDbType.Decimal, 0, ParameterDirection.Input, true, 18, 0, "", DataRowVersion.Current, Parameter3);
using (IDataAccessAdapter adapter = DataAccessManager.CreateAdapter())
{
adapter.CallRetrievalStoredProcedure("CUSTOMER_INFO", parameters, ds);
}
But after the "CallRetrievalStoredProcedure" is executed the following exception is thrown:
Unable to cast object of type 'System.Data.SqlClient.SqlParameter' to type 'Oracle.DataAccess.Client.OracleParameter'.
Is this the correct way to call a stored procedure and pass parameters to it?