I have problem and I've been looking for a week now on how to solve it. Yesterday I thought I solved but apparently I didn't when I tried the query with new data added in my database.
Here's my query
Public Function getTicketsByBeginstation(ByVal station As String) As Array
Dim r As Array
r = (From u In treinDataContext.Tickets Where u.ritId =
(From v In treinDataContext.Rittens Where v.trajectId =
(From s In treinDataContext.Trajectens Where s.beginstationId =
((From t In treinDataContext.Stations Where (t.naam = station) Select t.id).First) Select s.id).First Select v.id).First Select u.datumAankoop, u.betaalmethodeId, u.tijdAankoop, u.klasseId, u.ritId Order By datumAankoop Ascending).ToArray
Return r
End Function
The problem I have is: when I have a station selected there are more than 1 trajecten (connections in English) but I had to use the .first else Visual Studio would give the error "the '=' operator is not defined for 'integers' and 'system.linq.IQueryable(of integer)".
So I give the name of a station -> I have to select all trajectens with the given station as beginstation -> I have to select all ritten which have the given trajecten -> I have to select all tickets which have the given ritten
So: I have to show all tickets for a certain station.
Can anyone help me?