title: Problems converting an Oracle plsql stored procedure call to C# (invalid array bind size)
body: <p>I need convert a call to a stored procedure that we are using in PL/SQL to c# code using odp.net12.</p>
  
  <p>The stored procedure gets some parameters of a custom types.</p>
  
  <p>This is my stored procedure call:</p>
  
  <pre><code>DECLARE
    P_SCODSERIE    VARCHAR2(3);
    P_SCODUSER     VARCHAR2(30);
    P_SMODACESS    VARCHAR2(8);
    P_SVETCODOBS   LINEUP.PCK_PIR_TYPES.VT_ARRAY_STRING;
    P_SVETDSCCOMPL LINEUP.PCK_PIR_TYPES.VT_ARRAY_FORMULA;
    P_NVETITEM     LINEUP.PCK_PIR_TYPES.VT_ARRAY_INT;
    R_NCODERROR    NUMBER;
  BEGIN
    P_SCODSERIE := NULL;
    P_SCODUSER := 'TSR';
    P_SMODACESS := '00000001';
    P_SVETCODOBS(1) := '03';
    P_SVETDSCCOMPL(1) := 'comments about the item';
    P_NVETITEM(1) := 1;
  
    LINEUP.PCK_PIR_REQUEST_CMP.INSERTORDERCMP(
            P_SCODSERIE =&gt; P_SCODSERIE,
            P_SCODUSER =&gt; P_SCODUSER,
            P_SMODACESS =&gt; P_SMODACESS,
            P_SVETCODOBS =&gt; P_SVETCODOBS,
            P_SVETDSCCOMPL =&gt; P_SVETDSCCOMPL,
            P_NVETITEM =&gt; P_NVETITEM,
            R_NCODERROR =&gt; R_NCODERROR );
  END;
  /
  </code></pre>
  
  <p>When we convert this call to a C# code using odp.net, I'm getting an error </p>
  
  <pre><code>System.InvalidOperationException: OracleParameter.ArrayBindSize
  </code></pre>
  
  <p>but I can not find what my error on parameters.</p>
  
  <p><strong>My C# code:</strong></p>
  
  <pre><code>Oracle.DataAccess.Client.OracleCommand objCmd
      = new Oracle.DataAccess.Client.OracleCommand();
  
  objCmd.Connection = (Oracle.DataAccess.Client.OracleConnection) conn;
  objCmd.CommandText = "LINEUP.PCK_PIR_REQUEST_CMP.INSERTORDERCMP";
  objCmd.CommandType = CommandType.StoredProcedure;
  objCmd.BindByName = true;
  
  
  objCmd.Parameters
        .Add("P_SCODSERIE", Oracle.DataAccess.Client.OracleDbType.Varchar2).Direction
        = ParameterDirection.Input;
  
  objCmd.Parameters["P_SCODSERIE"].Value = null;
  
  
  objCmd.Parameters
        .Add("P_SCODUSER ", Oracle.DataAccess.Client.OracleDbType.Varchar2).Direction
        = ParameterDirection.Input;
  
  objCmd.Parameters["P_SCODUSER "].Value = "TSR";
  
  
  objCmd.Parameters
        .Add("P_SMODACESS", Oracle.DataAccess.Client.OracleDbType.Varchar2).Direction
        = ParameterDirection.Input;
  
  objCmd.Parameters["P_SMODACESS"].Value = "00000001";
  
  
  Oracle.DataAccess.Client.OracleParameter strVetCodObs
      = new Oracle.DataAccess.Client.OracleParameter("P_SVETCODOBS", OracleDbType.Varchar2, ParameterDirection.Input);
  
  strVetCodObs.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
  
  strVetCodObs.Value = new String[1] { "03" };
  
  strVetCodObs.Size = 1;
  
  strVetCodObs.UdtTypeName = "LINEUP.PCK_PIR_TYPES.VT_ARRAY_STRING";
  
  objCmd.Parameters.Add(strVetCodObs);
  
  
  Oracle.DataAccess.Client.OracleParameter strVetDescCompl
      = new Oracle.DataAccess.Client.OracleParameter("P_SVETDSCCOMPL", OracleDbType.Varchar2, ParameterDirection.Input);
  
  strVetDescCompl.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
  
  strVetDescCompl.Value = new String[1] { "comments about the item" };
  
  strVetDescCompl.Size = 1;
  
  strVetDescCompl.UdtTypeName = "LINEUP.PCK_PIR_TYPES.VT_ARRAY_FORMULA";
  
  objCmd.Parameters.Add(strVetDescCompl);
  
  
  Oracle.DataAccess.Client.OracleParameter nVetItem
      = new Oracle.DataAccess.Client.OracleParameter("P_NVETITEM", OracleDbType.Decimal, ParameterDirection.Input);
  
  nVetItem.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
  
  nVetItem.Value = new Int32[1] { 1 };
  
  nVetItem.Size = 1;
  
  nVetItem.UdtTypeName = "LINEUP.PCK_PIR_TYPES.VT_ARRAY_INT";
  
  objCmd.Parameters.Add(nVetItem);
  
  objCmd.Parameters
        .Add("R_NCODERRO", Oracle.DataAccess.Client.OracleDbType.Decimal).Direction
        = ParameterDirection.Output;
  
  
  if (conn.State != ConnectionState.Open) {
     conn.Open();
  }
  
  objCmd.ExecuteNonQuery();
  </code></pre>