title: How to OrderBy an integer in a string field in a Linq query
body: <p>I have some data coming out of an DB that I can't readily change the schema of.  I want to sort it and bind it to a control based on a numerical ID.  The problem is that the API stores the number in a string field instead of as an <code>int</code> and Linq barfs on the conversion attempt.</p>
  
  <pre><code>myControl.DataSource = dataFromDB.OrderBy(o =&gt; int.Parse(o.StringHoldingAnInt));
  </code></pre>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method, and this method cannot be translated into a store expression.</p>
  </blockquote>
  
  <p><code>Convert.ToInt32</code> doesn't work either.</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>Sorting as a string isn't suitable because the values aren't all the same length and it would order them like this:  1, 10, 11, 2, 3..</p>