0
votes

I have a simple web page which will display the contents of a database table. When the page is first loaded, I want the grid to be empty. The user will pick a date from a day, month and year dropdown list controls and then click update. The grid would then update with the rows from the table where the dates match.

What would be the best way to achieve this?

I've looked at quite a few examples on here but none seem to be quite what I am looking for.

1

1 Answers

1
votes

Just pass the date as parameter to filter your records

For example you can create a stored procedure or query like so:

CREATE PROCEDURE GetRecordbydate

@startdate DATETIME, @enddate DATETIME

AS

Select field1,field2,field3 from tablename where datefield between @startdate AND @enddate

Then pass that as parameter in your server side code to populate the table