Convert Sql to Linq

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blondieC
    New Member
    • Feb 2012
    • 1

    Convert Sql to Linq

    I need to group a simple table but can't figure how to in linq.
    The table has 3 columns. Fruit, Quantity, Quality. With

    1st Row values being: Orange, 4, Good
    2nd Row Values being: Apples, 2, Good
    3nd Row Values being: Orange, 2, Bad
    4nd Row Values being: Orange, 1, Good
    5nd Row Values being: Mango, 1, Good

    I need to be able to group by fruit,Quality so I get a result like this:

    Apples, 2, Good
    Mango, 1, Good
    Orange, 5, Good
    Orange, 2, Bad

    This seems to be very easy and straight forward in sql, but I am new to Linq.
Working...