i have a windows form application, and i want that when i execute the program, program must show me the main form quickly, but my program firstly do some operations (connecting to sql, filling the combobox etc. )
because in form_load function i call a function to fill the combo with sql database's datas.
But user does not want to wait, user wants to see the form very quickly.
In other words, user wants my program to connect sql and to fill the combo AFTER form has been shown to the user.

Recommended Answers

All 6 Replies

If you are dealing with a windows forms application simply move the data retrieval and population procedures to appear after the form initialization and that should get your result.

My question is, what use is an empty form showing up quickly vs a filled form showing up 2-3 seconds later? It really shouldn't take too long (depending on how large your database is and how vague your select statements are) to populate the form prior to displaying it in the first place.

it does not work man.
please firstly try your idea in your computer and then tell it to me please :)

1) Please post your code to show an example of how you are currently performing the task so people can work with that sample of code to try to help you

2) In order for what I said to work you need some sort of 'trigger' for the DB query and component load procedures that occurs AFTER form load, this can be a timer, or a button or whatever works best for your needs

3) I still don't see the point in having a form load "quickly" if the functionality of the form is non-existant due to missing population of data. But then again I don't see the point in criticizing people for posting suggestions on methods without first looking into how those methods might be implemented :)

>>please firstly try your idea in your computer and then tell it to me please
I'm not going to create a database, create a form, build the data connections and fill processes, just to pre-test a 'possible' solution when the initial question didn't provide any code reference to work with but thanks for the suggestion.

Best of luck with your issue :) Please remember to mark the thread solved once it has been.

okay is there another people asking to help me ? :D

Use timer control .Using that you can manage the execution of Sql Statements after any time interval.

using the timer control is a good idea.

You cam also display a button on the form, write your populating code inside the button's event, probably this would help only if the user wants the data to be populated after he triggers some event over the form.

the other possibility would be using 'Threads', but I dnt think using a Thread concept wud be good for this as this is a simple concept. U can go for the Timer control instead... as K.D.M said...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.