title: Call an Oracle function with parameters with VB.NET
body: <p>First of all, I'm from Argentina, sorry for mi poor english! </p>
  
  <p>I'm working in Visual.NET 2010, and I'm trying to make a call to a function in an Oracle package, but I get this error:</p>
  
  <p><strong>PLS-00306: wrong number or types of arguments in call to 'FN_FINDPRONOSTICO'</strong></p>
  
  <p>This is the package definition:</p>
  
  <pre><code>create or replace
  PACKAGE PKG_HOME AS
  
      TYPE CR_ESTACIONREFERENCIA IS REF CURSOR;
      TYPE CR_PRONOSTICO IS REF CURSOR;
      TYPE CR_ALERTA IS REF CURSOR;
      TYPE CR_ESTADIOSPREDOMINANTESZONA IS REF CURSOR;
      TYPE CR_VARIEDADES IS REF CURSOR;
  
      --FUNCTIONS
  
      FUNCTION FN_FINDESTACIONREFERENCIA(PR_IDZONAFENO IN NUMERIC) RETURN CR_ESTACIONREFERENCIA;
      FUNCTION FN_FINDPRONOSTICO(PR_IDESTACION IN NUMERIC) RETURN CR_PRONOSTICO;
      FUNCTION FN_FINDALERTAMETEO(PR_IDESTACION IN NUMERIC) RETURN CR_ALERTA;
      FUNCTION FN_FINDALERTAPLAGA(PR_IDZONAFENO IN NUMERIC) RETURN CR_ALERTA;
      FUNCTION FN_FINDALERTAENFERMEDAD(PR_IDZONAFENO IN NUMERIC) RETURN CR_ALERTA;
  
      PROCEDURE SP_ESTFENOPREDZONAVAR(pFechaDesde IN DATE, pFechaHasta IN DATE,pIdZona IN NUMBER ,pIdVariedad IN NUMBER);
  
      FUNCTION FN_ESTADIOSFENOPREDZONA(pIdZona IN NUMBER) RETURN CR_ESTADIOSPREDOMINANTESZONA;
  END;
  </code></pre>
  
  <p>And this is the code in VB.NET </p>
  
  <pre><code>Dim cmd As New OracleCommand("FRUTIC.PKG_HOME.FN_FINDPRONOSTICO", OraConn)
  cmd.CommandType = CommandType.StoredProcedure
  cmd.BindByName = True
  
  Dim oparam0 As OracleParameter = cmd.Parameters.Add("PR_IDESTACION", OracleDbType.Int64)
  oparam0.Value = 65
  oparam0.Direction = ParameterDirection.Input
  
  Dim oparam1 As OracleParameter = cmd.Parameters.Add("CR_PRONOSTICO", OracleDbType.RefCursor)
  oparam1.Direction = ParameterDirection.Output
  
  Dim reader As OracleDataReader
  reader = cmd.ExecuteReader()
  
  Do While reader.Read()
      Dim obj As Object
  
      obj = reader.GetValue(0)
  Loop
  </code></pre>
  
  <p>If I run this SQL statement (SELECT FRUTIC.PKG_HOME.FN_FINDPRONOSTICO(65) FROM DUAL) in Oracle SQL Developer, it returns the results correctly.</p>
  
  <p>Where could be the problem?</p>
  
  <p>Thank you very much in advance!
  Greetings from Argentina, Lucas</p>