PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Slow response binding to datagrid
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Slow response binding to datagrid
![]() |
Slow response binding to datagrid |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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" <Ant@discussions.microsoft.com> wrote in message news 42983C6-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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 "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" <Ant@discussions.microsoft.com> wrote in message > news 42983C6-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 > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

42983C6-2350-403E-8EF7-3175771BC6FC@microsoft.com...
