I am looking for some example code for search between to dates with c#
I created one stored procedure and one view.
The view is
select r.BUSINESSNAME, r.CONTACT, r.ADDRESS, r.CITY, r.STATE, r.ZIPCODE, r.PHONE, r.FAX, r.EMAIL, r.CITYCSBCERT, r.CSBxDate, r.CITYFBECERT, r.FBExDate, r.CITYMBECERT, r.MBExDATE, r.EDGECERT, r.EdgeExDate, r.DBE, r.DBExDate, r.SBE, r.SBExDate, r.CMHA,
r.CMHAExp, r.OTHER, r.OxDate, r.OtherDocs0, r.OtherDoc0Exp, r.OtherDocs1, r.OtherDocs1Exp from Registration r
where CMHAExp between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE())or
r.CSBxDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.FBExDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.MBExDATE between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.DBExDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.EdgeExDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.STATEMBExDATE between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.OtherDoc0Exp between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.OtherDocs1Exp between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.OxDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE()) or
r.SBExDate between DATEADD([day],-60, GETDATE()) and DATEADD([day],60, GETDATE())
This gives me 60 day window for expired data renewal.
I have this populate on page load.
The stored procedure gives the the ability to search out further in the future.
Create Procedure [dbo].[SearchExpirationDate]
@startDate smalldatetime,
@endDate smalldatetime
as
select r.BUSINESSNAME, r.CONTACT, r.ADDRESS, r.CITY, r.STATE, r.ZIPCODE, r.PHONE, r.FAX, r.EMAIL, r.CITYCSBCERT, r.CSBxDate, r.CITYFBECERT, r.FBExDate, r.CITYMBECERT, r.MBExDATE, r.EDGECERT, r.EdgeExDate, r.DBE, r.DBExDate, r.SBE, r.SBExDate, r.CMHA,
r.CMHAExp, r.OTHER, r.OxDate, r.OtherDocs0, r.OtherDoc0Exp, r.OtherDocs1, r.OtherDocs1Exp from Registration r
where CMHAExp between @startDate and @endDate or
r.CSBxDate between @startDate and @endDate or
r.FBExDate between @startDate and @endDate or
r.MBExDATE between @startDate and @endDate or
r.DBExDate between @startDate and @endDate or
r.EdgeExDate between @startDate and @endDate or
r.STATEMBExDATE between @startDate and @endDate or
r.OtherDoc0Exp between @startDate and @endDate or
r.OtherDocs1Exp between @startDate and @endDate or
r.OxDate between @startDate and @endDate or
r.SBExDate between @startDate and @endDate
I have written the code manually to connect to the grid view to populate on load.
I have 2 input text box startDate and endDate with a search button
I can manually write the code to access the stored procedure with now problem
I need to now how link my startDate box and endDate box that the stored procedure would see the dates that are entered.
I know this is a beginners question. So one day I hope to be a junior. :-D :-D