Click here to Skip to main content
13,093,245 members (76,902 online)
Rate this:
Please Sign up or sign in to vote.
See more:
My form has many controls. It take too time to load form. Is there any solution to reduce the loading time...
Posted 29-Nov-12 20:28pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Reduce the number of controls.

If you have so many that it is affecting the load time, then you need to look at it from a users' point of view and start moving some of them out of the main display - there is only soi much information you can take in at one time!

It may be worth looking at what you are doing with those controls - if they are all databound for example, then you need to make sure that you are not making a trip to the DB for every control, or loading information you don't need.
smiths3 30-Nov-12 3:43am
form is ready as per client requirement so that I can't reduce no. of controls on form. No control is bound to the database.. I am searching data from database and displaying that on controls.
OriginalGriff 30-Nov-12 3:47am
Then you need to look at how you are accessing the data, and how you are displaying that.
Try an experiment: remove the code to load any data at all, and see how fast the form loads then. If it's quick, then it *may* be possible to speed it up. If it is too slow, then you need to look at the PC spec or get the customer to change the form design. (This is one of the reasons I don't develop on top-of-the-range machines: if it is fast enough on my machine, it'll be good on the customers)
smiths3 30-Nov-12 5:39am
I have tried it by removing code at the loading time.. It is fast...
OriginalGriff 30-Nov-12 5:51am
Then you need to look at exactly how you are loading the data - it may be that you can optimise the existing code, or perhaps move some of it to a background thread so that the UI loads fast (but the user has to wait for the data).
I can't give you specifics - I don't know what you app does, and don't have access to your code - but the general rules are to make as few trips to the DP as you can, retrieve only the exact data you are interested in, and find out what is slow by using the Stopwatch class. You then have a benchmark to work from. This:
isn't exactly what you want, but it shows how I measure things when I'm trying to find out what works quickest.
smiths3 30-Nov-12 6:11am
Leave it. simple question .. how to load data in datagridview with fill method..
means is there any method in adodb to load datagrid faster..
smiths3 30-Nov-12 6:15am
can I use adobd to update records.. and oledb to display records on datagridview... means when i want to display more data the I use oledb connection and when I want to update something then I will use adodb..
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Create one .INI file and set the control you want to be appear. Better than you put into database.

I have some example that used to develop my project. It's by using configuration file. Which mean something that dynamic (value can be change) data such as Branch Code, Branch ID,Payment Type,Merchant.

;0 - Enable Merchant, 1 - Disable Merchant

Then load the value into property that can be use to whole process. Just like that

That's my recommendation. If you want to use this, I will explain how. That's my idea for u :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100