Data filtering

Data filtering

am 11.04.2008 12:16:01 von jez123456

Hi ASP.Net experts

I have a archived SQL Server 2000 database table with about 300,000 records,
and need to display filtered data on a ASP.Net 2 web page.

Basic filtering needs to be done on id, name and DOB fields, however,
advanced filtering could include between 1 and 10 different checkboxes being
check or unchecked.

What would be the best approach to this. Are there any examples I could view?

Many thanks

Re: Data filtering

am 11.04.2008 13:53:10 von mark

"jez123456" wrote in message
news:0DD4DF54-30CD-490E-8E14-9F644808234A@microsoft.com...

> I have a archived SQL Server 2000 database table with about 300,000
> records,
> and need to display filtered data on a ASP.Net 2 web page.
>
> Basic filtering needs to be done on id, name and DOB fields, however,
> advanced filtering could include between 1 and 10 different checkboxes
> being
> check or unchecked.
>
> What would be the best approach to this.

I would recommend using a stored procedure for this where the ID, name and
DOB fields are non-nullable (i.e. required) parameters and the other fields
which relate to the checkboxes are nullable (i.e. optional) parameters.

How you write the stored procedure will largely depend on the logical use of
the checkboxes.

I.e. if a checkbox is checked, does that mean you want to return only those
records where the field that the checkbox relates to is True and if the
checkbox is unchecked return only those record where the field that the
checkbox relates to is False or, if the checkbox is unchecked, does that
mean that you want to completely ignore the field that the checkbox relates
to...? If the latter, then you may be forced to build up the query
dynamically in the stored procedure and execute it with the sp_executesql
function:

http://www.google.co.uk/search?sourceid=navclient&hl=en-GB&i e=UTF-8&rlz=1T4GZEZ_en-GBGB252GB252&q=sp%5fexecutesql


--
Mark Rae
ASP.NET MVP
http://www.markrae.net