<asp:SqlDataSource ID="dsSearchResults" runat="server"
ConnectionString="<%$ ConnectionStrings:strConn %>"
<SelectCommand="SELECT StoreNumber, StoreName, Address, City, State, PostalCode, Phone, Email, Latitude, Longitude, SQRT(POWER(Latitude - @Latitude, 2) + POWER(Longitude - @Longitude, 2)) * 62.1371192 AS DistanceFromAddress
FROM Stores
WHERE (ABS(Latitude - @Latitude) < 1.75) AND (ABS(Longitude - @Longitude) < 1.75)
ORDER BY DistanceFromAddress">
<SelectParameters>
我想将搜索结果限制为前 5 个结果。我尝试了几种不同的方法,但无济于事。是的,我是新手,但想学习。我正在使用 SQL Server 2012。