I am trying to get one Integer from my database passed back to me as the following (I know it will be unique):
Dim SequenceyQuery = From a In db.ServiceSequences
Where (a.ServiceId = ReqService And a.StationId = AtStation)
Select a.Sequence
Dim TempSequence As Integer = CInt(SequenceyQuery.ToString)
But am getting problems trying to cast it in the second line of code. Is this the best way to get that integer from here and how to I get it as an integer?
You should not call
ToString()on your query.Call
First()instead, which will return the first element.