title: System.Data.Entity.Core.EntityCommandExecutionException Not handled by user code in query
body: <p>I've got a method inside of my <code>DataController.cs</code>:</p>
  
  <pre><code>public JsonResult MoveInLogin(LoginData d)
  {
      using (MoveInDBEntities dm = new MoveInDBEntities())
      {
          var user = dm.MoveIns.Where(a =&gt; a.CID.Equals(d.CID) &amp;&amp; a.Email.Equals(d.Email)).FirstOrDefault();
          return new JsonResult { Data = user, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
      }
  }
  </code></pre>
  
  <p>On that 4th line where the user is declared, is where this exception gets triggered:</p>
  
  <blockquote>
    <p>An exception of type
    'System.Data.Entity.Core.EntityCommandExecutionException' occurred in
    EntityFramework.SqlServer.dll but was not handled in user code</p>
  </blockquote>
  
  <p>As I looked in further, I noticed that Exception Details are:</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: The data types text and varchar
    are incompatible in the equal to operator.</p>
  </blockquote>
  
  <p>My column name CID is of type <code>varchar(10)</code> and Email is of type <code>text</code> in the SQL database. </p>
  
  <p>How can I format my query to get rid of this exception?</p>