title: csharp using sql query with special characters
body: <p>I have a scenario in my csharp code where I am trying to get records with special characters / and % using sql query.</p>
  
  <p>I tried executing query in sql query analyzer and it worked fine after adding square brackets.</p>
  
  <pre><code>Select * from tblDetails where name like '%[\]%' or name like '%[%]%' 
  </code></pre>
  
  <p>But it fails when I use it in csharp</p>
  
  <pre><code>string sqlQuery = "Select * from tblDetails where name like '%[/]%' or name like '%[%]%' ";
  using (SqlCommand command = new SqlCommand(strQuery, strConnection))
  </code></pre>