title: using local variable value in SQL statement in C#
body: <p>I am trying to subtract number of days from a date dynamically in sql atatement in </p>
  
  <pre><code>C# code I have is
  int myInt=6;       //its value will vary
    var q = SELECT [DATE] FROM DB WHERE  [Date ] &lt; DATEADD(dd, **myint**, GETDATE())";
  </code></pre>
  
  <p>is there way to pass this variable in sql statement ? </p>
  
  <p>I tried this </p>
  
  <pre><code> var q = SELECT [DATE] FROM DB WHERE  [Date ] &lt; DATEADD(dd, [coumln]+"'+myint+'", GETDATE())";
  </code></pre>