title: LINQ to DataSet case insensitive group by
body: <p>I have a data table and I want to perform a case insensitive group by over a column of data table (say <code>Column1</code> of type string). I observed that normally LINQ to DataSet performs a case sensitive comparison. For example, if <code>Column1</code> has two string values "Test" and "test", after applying <code>group by</code> it returns two separate rows with the values "Test" and "test", instead of one.</p>
  
  <p>The query is:</p>
  
  <pre><code>var countGroupQuery = from table in dataTable.AsEnumerable()
                        group table by table.Field&lt;string&gt;(Column1) into groupedTable
                        select new
                        {
                            value = groupedTable.Key,
                            count = groupedTable.Count()
                        };
  </code></pre>
  
  <p>Is there any method to perform a case-insensitive <code>group by</code> so that in the above example I get only one row with one value (either "Test" or "test")? <code>ToUpper</code> or <code>ToLower</code> would actually change the values to either upper case or lower case instead of using at least one of the input values, so I don't want to use this:</p>
  
  <pre><code>group table by table.Field&lt;string&gt;(Column1).ToUpper() into groupedTable
  </code></pre>