Hi every one,
i am working on a geolocation project, I have created a stored procedure for haversine formula and need to get the distance value back in a label in asp.net c# form.
Could you help please, Below is my code.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Haversine]
(
@sourceLatitude FLOAT ,
@sourceLongitude FLOAT ,
@destinationLatitude FLOAT ,
@destinationLongitude FLOAT ,
@distance FLOAT
)
AS
SET NOCOUNT OFF;
SET @Location = SQRT(POWER(69.1 * ( @destinationLatitude - @sourceLatitude), 2) + POWER(69.1 * ( @sourceLongitude - @destinationLongitude ) * COS(@destinationLatitude / 57.3), 2))
PRINT @distance