Store procedure for desktop application
ALTER procedure [dbo].[one_mnth_ago]
as
DECLARE @StartDate DATETIME, @EndDate DATETIME
SET @StartDate = dateadd(mm, 0, getdate())
SET @StartDate = dateadd(dd, datepart(dd, getdate())*0, @StartDate)
SET @EndDate = dateadd(mm, 1, @StartDate)
begin
SELECT *
FROM installation
WHERE warranty_expry_date BETWEEN @StartDate AND @EndDate
end
how to run this procedure in desktop application.and retrieve data in gridview