title: LINQ - Sorting by using OrderBy on a nullable field
body: <p>I'm trying to sort a collection of type <code>Enumerable&lt;DataRow&gt;</code> by using LINQ's OrderBy method on a nullable Int32 field. Because some of the values of this field are null, Visual studio throws a System.ArgumentException with message 'Object must be of type Int32.' Here is the problematic line of code:</p>
  
  <pre><code>collection1 = collection1.OrderBy(row =&gt; row["Column1"]); 
  </code></pre>
  
  <p>where Column1 is the nullable Int32 field and the variable <code>collection1</code> is declared as:</p>
  
  <pre><code>IEnumerable&lt;DataRow&gt; collection1;
  </code></pre>
  
  <p>Is there a way to rewrite the above line so that it ignores the nulls? </p>