title: ODP.NET How to pass array of strings to an Oracle Stored procedure?
body: <p>There's numerous question and <a href="http://docs.oracle.com/cd/E11882_01/win.112/e18754/featOraCommand.htm#BABBDHBB" rel="nofollow">confusing</a> <a href="http://docs.oracle.com/cd/E11882_01/win.112/e18754/featOraCommand.htm#i1007888" rel="nofollow">docs</a> on the subject, but no luck so far.</p>
  
  <p>I've the following PL/SQL stored procedure;</p>
  
  <pre><code>PROCEDURE PS_test(
    Liste1 Listcar,
    Liste2 Listcar,
    P_CURS_MESSAGE out CURSOR_REF_TYP
  )
  </code></pre>
  
  <p>Where the type <code>Listcar</code> is the following:</p>
  
  <p>TYPE Listcar IS VARRAY(100) OF VARCHAR2(50);</p>
  
  <p>Here is what I'm trying so far:</p>
  
  <pre><code>string[] list = { "name1", "name1" };
  
  OracleParameter oParam = (OracleParameter)myOracleCommand.CreateParameter();
  oParam.ParameterName = "Liste1";
  oParam.UdtTypeName = "LISTCAR";
  oParam.Value = list;
  oParam.Direction = ParameterDirection.Input;
  myOracleCommand.Parameters.Add(oParam);
  </code></pre>
  
  <p>With the following error on the Value assignment:</p>
  
  <pre><code>Value does not fall within the expected range.
  </code></pre>
  
  <p>Tried to use the type varchr2, to set the ArrayBindSize and so on, but no luck so far.</p>
  
  <p>I guess the interface <code>IOracleArrayTypeFactory</code> might play a role somewhere, but how? </p>