title: Dynamic LINQ with datetime
body: <p>I am trying to write a simple linq select query, where in the where clause the value is taken from a text box. I am having problem in case of datetime values. Now this works:</p>
  
  <pre><code> var rawData = contextSearch.GetType().GetProperty(TableName).GetValue(contextSearch, null);
   truncatedData = ((IQueryable&lt;object&gt;)rawData).Where(columnName + "&gt;=@0", DateTime.Parse(txtCrudSearch.Text)).ToList();
  </code></pre>
  
  <p>this also works for &lt;=, but I need to find records for exactly the given date. So, when I try this:</p>
  
  <pre><code>truncatedData = ((IQueryable&lt;object&gt;)rawData).Where(columnName + "=@0", DateTime.Parse(txtCrudSearch.Text)).ToList();
  </code></pre>
  
  <p>It doesn't work. Why? How can I get this to work? FYI: columnname is taken from combobox dynamically and I'm using entity framework. </p>