Search Filter on a DB Application
Posted on 2012-09-05
I have a usercontrol with a gridview, and a textbox called search criteria, for which the TextChanged event populates the gridview.
The tables being searched are fairly large, so the SP is set to return the top 100 rows.
My problem with this is that if you type something in, it will rerun the SP for each letter you type e.g. type in the name Pink Floyd and this would requery the DB for "P", then for "i" then for "n", etc.. , In this case requerying a total of 10 times.
This causes the control to slow down considerably when someone types in search criteria at normal typing speed.
This automated populating functionality is already in place, and so won't be removed, so I'm looking for help on a way to reduce the calls made to the database based on the time between keypresses.
Can anyone help me with a method to do this, that would not itself cause alot of overhead / sluggish response