title: Compare Date values in Entity Framework
body: <p>I'm trying to compare date values in entity framework.</p>
  
  <pre><code>DateTime selectedDate = Calendar1.SelectedDate;      
  var result = context.EventsTable.Where(ev =&gt;ev.EventDate.Equals(selectedDate));
  </code></pre>
  
  <p>ev.EventDate is coming from SQL Server 2008 and selectedDate is ASP:Calendar's Selected date.
  In SQL Server 2008 date is stored as: 2012-09-03 00:00:00 
  whereas date value from Calendar's SelectedDate is in 2012-09-03 12:00:00AM format.</p>