title: VB.NET LINQ Group By Multiple Columns
body: <p>I have the following LINQ code which has a syntax error and i've no idea how to fix it</p>
  
  <pre><code>         Dim query =
          From row In mainDatatable.AsEnumerable
  
      'the syntax Error is in the following line
        Group row By new  { row.Field(Of Double)("cprice") , row.Field(Of Integer)("ccategory")} 
  Into ProductGroups
      '**************************
  
                  Dim grpNumber = 1
                  For Each grp In query
                      For Each row In grp.ProductGroups
                          row.SetField("gnum", grpNumber)
                      Next
                      grpNumber += 1
                  Next
  
  
              End Sub
  </code></pre>
  
  <p>so what am i doing wrong?</p>
  
  <p>Here is how the table looks like and i want to group by the columns cprice and ccategory</p>
  
  <pre><code>+---------------+---------------+-----------+------+
  | Product Name  | cprice        | ccategory | gnum |
  +---------------+---------------+-----------+------+
  | Skirt Red     |            99 |         1 |      |
  | Jeans Blue    |            49 |         2 |      |
  | Jeans Black   |            49 |         2 |      |
  | Skirt Blue    |            99 |         1 |      |
  | T-shirt White |            20 |         2 |      |
  | T-shirt Green |            20 |         2 |      |
  | Jeans Grey    |            49 |         2 |      |
  +---------------+---------------+-----------+------+
  </code></pre>