Slow response Autocomplete

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm using the text changed event of as text box to display a datagrid of
search results dynamically. (The classic 'gets more specific the more you
type in' scenario ).

I find when I first start the app & type in something into the text box, it
stalls & won't display the text you've typed in. After a short while, the
text appears & the results are loaded into the data grid. After the first
time, it works perfectly; loading data in as you type. (i.e. Type in A, you
get all rows beginning with A, type in Ax, you get fewer rows etc. ).
Why would it be so slow first time but ok after that? It's always re
instantiating the same class to do it. Has this got something to do with
memory caching & if so, how can I fix this so it works fast first time?

Hope that's a clear explanation...

Thanks for any ideas in advance.
Ant
 
Hi Ant,
where are you storing your information, inside a database? If so then it
could be slow to begin with because the first time you try to connect to he
DB a connection will be made, which is an intensive process, after that the
connections will be pooled, so obtaining a connection to the DB is very fast.

Mark Dawson
http://www.markdawson.org
 
Hi Mark,

That sounds about right. It's pulling it from a db. What can I do to stop
this occuring? Should I open the connection on form load? Really not sure.

Thanks very much for your answer
Ant
 
Hi Ant,
like you mentioned you could just ping the database, i.e. call a stored
procedure, on the load of the form so that you establish a connection, then
you will not get the delay once you try to do the autocomplete functionality.

Mark.
 
Back
Top