I have some older methods using sql strings and connections that I'm trying to convert to Linq to Entities.
I have rewritten the sql to an ef query as follows;
Using ctx As New DataEntities()
        Dim station As String = (From sta In ctx.weather_stations
                                 Let distance = SqlFunctions.SquareRoot(Math.Pow(69.1 * (sta.latitude - lat), 2) + Math.Pow(69.1 * (longi - sta.longitude) * SqlFunctions.Cos(sta.latitude / 57.3), 2))
                                 Where distance < withinRange
                                 Order By distance
                                 Select sta.station_id).Take(1).ToString()
        If Not String.IsNullOrEmpty(station) Then
            Return station
        Else
            Return String.Empty
        End If
    End UsingData
This gives an error, LINQ to Entities does not recognize the method 'Double Sqrt(Double)' method, and this method cannot be translated into a store expression.
Can this query be done in Linq to EF? If so, how can I reconstruct this query to work?
