title: How compare SQL Server Datetime from C#
body: <p>I've got to make a query from C# and compare with a <code>datetime</code>. Datetime is stored in my database like this: </p>
  
  <pre><code>2014-11-09 00:00:01
  </code></pre>
  
  <p>and I'm using this query:</p>
  
  <pre><code>SELECT * 
  FROM Table 
  WHERE DATETIMEVAR = '19/11/2014 0:00:01' AND OTHERVAR = 1
  </code></pre>
  
  <p>But it's not in the same format. Is there a way to convert from <code>System.DateTime</code> in C# to dates in SQL Server, or a way to cast from SQL Server the datetime in that format?? Should I check with <code>like</code> instead of <code>=</code> in <code>Where</code> clause.</p>
  
  <p>Thanks.</p>