What am I doing wrong here?
I have the following object defined:
Public Class MyClass
Public Var1 As String
Public StartDate As Date
Public EndDate As Date
End Class
And in my Main sub, I have:
Dim x as New List(Of MyClass)
Now, I want to group this such that all groups will have info that has matching start and end dates. I thought this should do it:
From Req In x
Group Req By strtdt = Req.StartDate, enddt = Req.EndDate Into grp
Select ...
Now, I have tried this in a few different ways and each time get different errors:
1)
From Req In x
Group Req By strtdt = Req.StartDate, enddt = Req.EndDate Into grp
Select ...
ERROR: Definition of method 'grp' is not accessible in this context
(grp() underlined)
2)
From Req In x
Group Req By New With {strtdt = Req.StartDate, enddt = Req.EndDate} Into grp
Select ...
ERROR: Type or 'With' expected
(First curly brackets underlined)
What am I doing wrong???
Thanks!