title: Using named parameters with MySQL .NET Provider
body: <p>In the MySQL .NET provider, you can use named parameters in the syntax:</p>
  
  <pre><code>?parametername
  </code></pre>
  
  <p>Now, I'm trying to create a named parameter for a parameter that will be used in an 'IN' list, e.g. :</p>
  
  <pre><code>select * from mytable where id in (?ids)
  </code></pre>
  
  <p>How can I use a named parameter with this, if I use varchar, it will add quotes before and after the list, ie.:</p>
  
  <p>If I pass the value of the parameter using varchar:</p>
  
  <pre><code>cmd.Parameters.Add("?ids", MySqlDbType.Varchar).Value = ids; // ids is a string which contains the ids separated by commas, e.g. 1, 2, 3 .. etc
  </code></pre>
  
  <p>the query will be executed like this:</p>
  
  <pre><code>select * from mytable where id in ('1, 2 ,3')
  </code></pre>
  
  <p>Of course this will throw an error, how can I pass a named parameter without getting the quotes, this is the way it should be executed:</p>
  
  <pre><code>select * from mytable where id in (1, 2 , 3)
  </code></pre>
  
  <p>Is there any workaround for this? I'm currently using String.Format() but would like to use a named parameter, is this possible some how?</p>
  
  <p>P.S. I'm only using plain text statements, no sproc, so none of this is going to be passed to an sproc (just in case you think it's not possible because sprocs don't accept arrays)</p>