title: SQL SELECT Arrays in C#?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/114504/is-it-possible-to-send-a-collection-of-ids-as-a-ado-net-sql-parameter">Is it possible to send a collection of ID&rsquo;s as a ADO.NET SQL parameter?</a>  </p>
  </blockquote>
  
  <p><strong>Duplicate:</strong> this is a duplicate of <a href="https://stackoverflow.com/questions/114504/is-it-possible-to-send-a-collection-of-ids-as-a-ado-net-sql-parameter">Is it possible to send a collection of ID’s as a ADO.NET SQL parameter?</a> and many others. Please vote to close it and add any additional answers to one of the other duplicates.</p>
  
  <p>Given an array of parameters, I want to write a SELECT/WHERE/IN statement that can handle it. I would have thought I could do something like this.</p>
  
  <pre><code>// Given List&lt;int&gt; listOfLanguageIDs...
  string cmdText =
      "SELECT StringID\n" +
      "FROM TRANSLATIONTB\n" +
      "WHERE LanguageID IN(@arrayOfLanguagesIDs)";
  
  using (SqlCommand command = new SqlCommand(cmdText, ConnectionManager.Connection))
  {                       
      command.Parameters.Add( "arrayOfLanguagesIDs", SqlDbType.IntArray ).Value = listOfLanguageIDs.ToArray();
  
  ...
  </code></pre>
  
  <p>But alas, this does not seem to be the case, and my searching hasn't turned up anything. Am I asking the wrong questions? Or does everyone really write their own array builder/SqlDbType converter/etc?</p>