title: Convert String To Int in LINQ
body: <p>I have a LINQ query that queries a DataTable.  In the DataTable, the field is a string and I need to compare that to an integer, basically:</p>
  
  <pre><code>if ((electrical &gt;= 100 &amp;&amp; electrical &lt;= 135) || electrical == 19)
  {
      // The device passes
  }
  </code></pre>
  
  <p>the problem is, I am trying to do this in LINQ like this:</p>
  
  <pre><code>        var eGoodCountQuery = 
              from row in singulationOne.Table.AsEnumerable()
              where (Int32.Parse(row.Field&lt;String&gt;("electrical")) &gt;= 100 &amp;&amp;
                     Int32.Parse(row.Field&lt;String&gt;("electrical")) &lt;= 135) &amp;&amp;
                     Int32.Parse(row.Field&lt;String&gt;("electrical")) != 19 &amp;&amp;
                     row.Field&lt;String&gt;("print") == printName
              select row;
  </code></pre>
  
  <p>I keep getting the exception:</p>
  
  <blockquote>
    <p>Input string was not in a correct format</p>
  </blockquote>
  
  <p>The main problem occurs when electrical == ""</p>