I have the following procedure in my bank:
I'mtryingtocallmystoreprocedurein.netlikethis:
publicintCountEvent(intresourceId,inteventCounterDefinitionId,DateTimestartDate,DateTimestopDate){intret=0;using(OracleConnectionconn=newOracleConnection(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 I execute my code, it gives the error message:
Incorrect number of argument types in call to
'COUNT_EVENT'
Can anyone help me with why the parameters are wrong?