By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,478 Members | 1,833 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,478 IT Pros & Developers. It's quick & easy.

Slow response Autocomplete

P: n/a
Ant
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
Feb 8 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

"Ant" wrote:
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

Feb 8 '06 #2

P: n/a
Ant
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

"Mark R. Dawson" wrote:
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

"Ant" wrote:
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

Feb 8 '06 #3

P: n/a
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.
"Ant" wrote:
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

"Mark R. Dawson" wrote:
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

"Ant" wrote:
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

Feb 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.