title: SQL LIKE: How to add string variable in SQL like statement?
body: <p>Is it possible to add a string variable in SQL Like statement?</p>
  
  <p>This is what i want:</p>
  
  <pre><code>String client = Request.QueryString["Text"];
  String cString = "SELECT UserName FROM dbo.UserData WHERE UserName LIKE '" + client + "'%";
  </code></pre>
  
  <p>There will an error occur when i put <strong>cString</strong> in <strong><code>SqlCommand</code></strong>.</p>
  
  <p>I think the problem is <strong>'" + client + "'%</strong> ,but i cant't figur out.</p>
  
  <p>Can someone help me? </p>