471,627 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Slow response Autocomplete

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
3 2621
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
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
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.

Similar topics

40 posts views Thread by Alex | last post: by
2 posts views Thread by Mrinal Kamboj | last post: by
8 posts views Thread by nil | last post: by
3 posts views Thread by John | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.