title: Escape Character for SQL in C#
body: <p>I want to add a simple select statement in my C# code. Sample looks like below.  The value like y in fname comes from a parameter.
      //select lname from myTable where fname = 'y'</p>
  
  <p>Here's what I m doing. I m obviously getting Sql Exception. How do I correct it? Thanks.</p>
  
  <pre><code>string strOrdersOrigSQL = "SELECT LastName FROM Employees";
  // Concatenate the default SQL statement with the "Where" clause and add an OrderBy clause
         strOrdersSQL = strOrdersOrigSQL + "where FirstName ="+ 'strFname';
  </code></pre>