1
I have the following Procedure in my bank:
I’m trying to call my store Procedure in the .net in this way:
public int CountEvent(int resourceId, int eventCounterDefinitionId, DateTime startDate, DateTime stopDate)
{
int ret = 0;
using (OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings[MyConnectionStrings.Default].ConnectionString))
{
try
{
conn.Open();
Console.WriteLine("ServerVersion: {0} \nDataSource: {1} \nHostName: {2}",
conn.ServerVersion, conn.DataSource, conn.HostName);
OracleCommand com = new OracleCommand("PRODUCTION.COUNT_EVENT", conn);
OracleParameter paramiter1 = new OracleParameter();
com.Parameters.Add("@P_RESOURCEID", resourceId);
com.Parameters.Add("@P_EVENTCOUNTERDEFINITIONID",eventCounterDefinitionId);
com.Parameters.Add("@P_SHIFT_START", startDate);
com.Parameters.Add("@P_SHIFT_END", stopDate);
com.CommandType = System.Data.CommandType.StoredProcedure;
com.ExecuteReader();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
return ret;
}
However, when executing my code, it gives the error message:
Incorrect number of argument types in the call to
'COUNT_EVENT'
Could someone help me in why the parameters are wrong?
Next time try not to post images and without the code snippets.
– Luiz Santos