title: ASP.NET passing value from textbox to selectcommand with IN vb
body: <p>I have an asp.net webpage with an asp.net  gridview with the following query:</p>
  
  <pre><code> SelectCommand="SELECT * from details2 as t2 WHERE (t2.OCC IN ('+ @txtCOUNTRY +') OR t2.DCC IN ('+ @txtCOUNTRY +')) and t2.ac='Y'"
  </code></pre>
  
  <p>The textbox <code>txtCOUNTRY</code> value can have the following values (for example):</p>
  
  <blockquote>
    <p>'AR','ES' </p>
  </blockquote>
  
  <p>However the parameter <code>@txtCOUNTRY</code> doesn't seem to be properly, written as the gridview shows nothing.</p>
  
  <p>if I change it to (for example) it works: </p>
  
  <pre><code> SelectCommand="SELECT * from details2 as t2 WHERE (t2.OCC IN ('AR,'ES') OR t2.DCC IN ('AR','ES')) and t2.ac='Y'"
  </code></pre>
  
  <p>So I can only assume the <code>@txtCOUNTRY</code> parameter is incorrectly written.</p>
  
  <p>Any ideas ?</p>