How to increate data loading performance?

A

abc my vclass

In my application, it reads several tables from database when loading the
form. Many users feel the application hang. How can I improve the
performance of this application.

The application load data table by table. I known ADO.NET can read all
resultsets one pass. But my case, each users have difference data tables
will load on the start application. It hard to apply one pass loading.
 
M

Miha Markic [MVP C#]

Load data in worker thread - see .net 2 BackgroundWorker component or do it
using threads.
 
C

Cor Ligthert [MVP]

ABC,

Have a look at your design again and see if it is really necesarry to load
everything at the start.

The "Where" clause is not for nothing in SQL, while it is as well not for
nothing that you can "Select" specific columns.

As I understand your desing well, than your datatables will foreever be read
one by one (the dataadapter uses a datareader), whatever you try.

You can get the feeling of the client a little bit better by adding an avi.
However in the design you took, he normaly can not do actions (beside
closing the application, minimize and maximize the form or move it a little
bit until the tables are loaded ). Therefore extra threads will probably
only give you a wors maintainable program (You can therefore as well set an
applications.doevents between the different fills (this not for moving the
window))

I hope this helps,

Cor
 
W

W.G. Ryan - MVP

There are a few areas. Like Miha mentions, going Async is the best way to
give the impression of performance (although remember threadign doesn't
actually make it faster, it just makes it more responsive). But you can do
a lot of other things like check the queries, minimize what you're pulling
back, disable constraints while loading the data etc). bang for the buck
though, either a few new threads and/or BeginInvoke is the way to go.
 
W

William \(Bill\) Vaughn

All good suggestions but might I add another idea?
For "smart client" applications, I find that the content relevant to the
user needs to be stored on the user's system--not necessarily in the
database. I would build persisted data into the design and store it locally.
In some cases this might be stored in the local SQLEXPRESS instance or in
simple flat files. No, I'm not implying that you should store this stuff in
XML--not if you care a snit about performance. As the application and user
work together, this local data store would contain more and more
user-centric data. For data that does not change, ship it with the
application and have the user load it off the CD/DVD or an installed
hard-disk file--this can also apply to data that changes occasionally. This
approach eliminates network traffic (a bottleneck in many applications).

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
A

ABC

Yes, your ideas is my points. But the local data must to be refresh from
data when application first run. In fact, at this time, the data refreshing
is make my application seem like hang, so some users might kill this
application and restart. I need to reconsider the another data refreshing
strategies.
 
W

William \(Bill\) Vaughn

Whenever I start an application that takes more than a few seconds to start,
I use a splash screen and run the user configuration operations
asynchronously. I also don't overload the Form_Load event. This makes the
application show the initial screen more quickly. I use other async
operations that complete population in the background while the user's eyes
are focusing.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top