title: Linq to Entity compare two string in Where clause
body: <p>I've got an error:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.</p>
  </blockquote>
  
  <p>The piece of code:</p>
  
  <pre><code>plist= plist.Where(p =&gt; Convert.ToInt(p.Period) &gt;= syslockPeriod);
  </code></pre>
  
  <p>p.Period example: 201206</p>
  
  <p>pList is <strong>IQueryable</strong>.  p.Period is string typed. sysLockPeriod is int.</p>
  
  <p>How to fix it?</p>