Click here to Skip to main content
11,496,146 members (595 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: VB.NET
My vb.net form has many controls. It take too time to load form. Is there any solution to reduce the loading time...
Posted 29-Nov-12 21:28pm
dcba1893
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.
  Permalink  
Comments
smiths3 at 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 at 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 at 30-Nov-12 5:39am
   
I have tried it by removing code at the loading time.. It is fast...
OriginalGriff at 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:
http://www.codeproject.com/Tips/312312/Counting-lines-in-a-string
isn't exactly what you want, but it shows how I measure things when I'm trying to find out what works quickest.
smiths3 at 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 at 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..
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.

[MERCHANT]
SPLITTER=,
;0 - Enable Merchant, 1 - Disable Merchant
MERCH1=0,CU,CREATE USER
MERCH2=0,DU,DELETE USER
MERCH3=0,CJ,CREATE JOB

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 Smile | :)
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2015
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