Home All Groups Group Topic Archive Search About

Slow response binding to datagrid

Author
9 Feb 2006 7:05 AM
Ant
Hi,

I'm using a text box's text changed event to autocomplete a datagrid as the
user types in the search value ('A' returns many, 'Ax' returns fewer etc).

The first few letters typed in take a while to populate the datagrid. Once
it populates, there is no further problem, each new text change event
immediately returns a fresh set of rows.

I found it slows down when binding the dataset to the datagrid the first
time, but subsequent times no problem. I have pinged the DB with a connection
before starting the initial connection but this makes no difference.

// Bind the data grid to the results
dgDisplayResults.DataSource = dsResults;  // slows here first time
round,then ok

Any clues as to what could be causing this?

Many thanks for any ideas
Ant

Author
12 Feb 2006 12:00 PM
Alec MacLean
I have noticed same behaviour in both Win- and Web-forms datagrids when in
debug mode (using VS2k3).  The delay doesn't seem to occur when compiled in
Release mode, so perhaps the associated debug symbols are causing the
initial delay?

Do you find the problem still occurs in the Release compiled version?

Also, possibly the query is not optimised on first run, then being
subsequently optimised, improves the return times?  Not sure this would
really be the issue, but you could examine the execute duration in Query
Analyser.

Al



Show quote
"Ant" <A**@discussions.microsoft.com> wrote in message
news:D42983C6-2350-403E-8EF7-3175771BC6FC@microsoft.com...
> Hi,
>
> I'm using a text box's text changed event to autocomplete a datagrid as
> the
> user types in the search value ('A' returns many, 'Ax' returns fewer etc).
>
> The first few letters typed in take a while to populate the datagrid. Once
> it populates, there is no further problem, each new text change event
> immediately returns a fresh set of rows.
>
> I found it slows down when binding the dataset to the datagrid the first
> time, but subsequent times no problem. I have pinged the DB with a
> connection
> before starting the initial connection but this makes no difference.
>
> // Bind the data grid to the results
> dgDisplayResults.DataSource = dsResults;  // slows here first time
> round,then ok
>
> Any clues as to what could be causing this?
>
> Many thanks for any ideas
> Ant
Author
13 Feb 2006 2:07 AM
Ant
Hi Alec,

Thanks for sharing your experiences. I tried in release mode but to no
avail. i have since noticed that loading another form stops the initial lag
time. Interestingly the form also takes a while to load so I'm going to
investingate what they share & try to pre load 'that' (whatever that may turn
out to be). I'm precompiling the query using prepare. Either way doesn't
change things, but thanks for the ideas. I will have a look at it in query
analyser.

Thanks for your assistance anyway
Ant

Show quote
"Alec MacLean" wrote:

> I have noticed same behaviour in both Win- and Web-forms datagrids when in
> debug mode (using VS2k3).  The delay doesn't seem to occur when compiled in
> Release mode, so perhaps the associated debug symbols are causing the
> initial delay?
>
> Do you find the problem still occurs in the Release compiled version?
>
> Also, possibly the query is not optimised on first run, then being
> subsequently optimised, improves the return times?  Not sure this would
> really be the issue, but you could examine the execute duration in Query
> Analyser.
>
> Al
>
>
>
> "Ant" <A**@discussions.microsoft.com> wrote in message
> news:D42983C6-2350-403E-8EF7-3175771BC6FC@microsoft.com...
> > Hi,
> >
> > I'm using a text box's text changed event to autocomplete a datagrid as
> > the
> > user types in the search value ('A' returns many, 'Ax' returns fewer etc).
> >
> > The first few letters typed in take a while to populate the datagrid. Once
> > it populates, there is no further problem, each new text change event
> > immediately returns a fresh set of rows.
> >
> > I found it slows down when binding the dataset to the datagrid the first
> > time, but subsequent times no problem. I have pinged the DB with a
> > connection
> > before starting the initial connection but this makes no difference.
> >
> > // Bind the data grid to the results
> > dgDisplayResults.DataSource = dsResults;  // slows here first time
> > round,then ok
> >
> > Any clues as to what could be causing this?
> >
> > Many thanks for any ideas
> > Ant
>
>
>

AddThis Social Bookmark Button