title: ORA-06550: Wrong number or type of arguments error when calling a function inside an oracle package in ASP.NET
body: <p>I have a function inside an oracle package called TEST in an Oracle 10g database</p>
  
  <pre class="lang-sql prettyprint-override"><code>FUNCTION GetEname(P_ename IN VARCHAR2) RETURN VARCHAR2 AS
  retVal VARCHAR2(10);
  BEGIN
  retVal := SUBSTR(P_ename, 3, INSTR(P_ename, ':', 1, 2) - 3);
  
  RETURN RetVal;
  
  END GetEntDefIEIDFromEname;
  </code></pre>
  
  <p>I have created an ASP.net page and I have the following code in the page_load:</p>
  
  <pre><code>String strResult = "";
          try
          {   
              oracleConn.ConnectionString = ConfigurationManager.ConnectionStrings["OracleDatabase"].ConnectionString;
              oracleConn.Open();
              OracleCommand orclCmnd = new OracleCommand();
              orclCmnd.Connection = oracleConn;
              orclCmnd.CommandText = "TEST.GetEname";
              orclCmnd.CommandType = CommandType.StoredProcedure;
  
              OracleParameter ename = new OracleParameter();
              ename.ParameterName = "ename";
              ename.OracleType = OracleType.VarChar;
              ename.Direction = ParameterDirection.Input;
              ename.Value = "0:490330";
              orclCmnd.Parameters.Add(ename);
  
              strResult = (String)orclCmnd.ExecuteOracleScalar();
  
              oracleConn.Close();
              oracleConn.Dispose();
  
              lbl1.Text = "Result of  " + strResult;
          }                
          catch (Exception ex)
          {
              Console.Out.WriteLine(ex.ToString());
              oracleConn.Close();
          }
  </code></pre>
  
  <p>When I run the code I get the following error message:</p>
  
  <blockquote>
    <p>"ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of
    arguments in call to 'GETENAME'\nORA-06550: line 1, column 7:\nPL/SQL:
    Statement ignored\n"} System.Exception
    {System.Data.OracleClient.OracleException}</p>
  </blockquote>