I've seen many examples in LINQ but i'm not able to reproduce the same result in vb.net.
I have following code:
Dim context As New MyModel.Entities()
Dim rnd As New System.Random()
Dim gardens As List(Of Tuin) = (From t In context.Gardens Where _
t.Approved = True And _
Not t.Famous = True _
Order By rnd.Next() _
Select t).ToList()
But i receive an error when binding this list to a control.
LINQ to Entities does not recognize the method 'Int32 Next()' method, and this method cannot be translated into a store expression.
Any suggestion on how to get this to work?