LINQ VB.NET variable not found when looping through grouped query
- by Ed Sneller
I'm trying to do the following LINQ grouping, which works in the debugger (the results are populated in the GroupedOrders object. But VS 2008 gives me the following error at design time...
Name 'x' is not declared
Dim GroupedOrders = (From m In thisConsultant.orders _
Group m By Key = m.commCode Into Group _
Select commCode = Key, orders = Group)
For Each x In GroupedOrders
Next
VS 2008 gives me the following error,