How to focus on Main form(Progress Bar) while data are inserted in database???

Posted by Pramodmca09 under C# on 9/19/2009 | Views : 2898 | Status : [Member] | Replies : 1
I have devloped an application(windows), I'm inserting data from two tables in to An Excel sheet. Table have thousands of entries. Everything is working smooth.

Since tables have thousands of record so while joining it takes minutes . I'hv used progress bar to show progress but when I click on the Join button my form gets white blank screen it remains white untill all records gets insert.
I'm matching records simply using select * where (condition)and(condition)and(condition).

So help me to show the progress bar while background process...
also help me to increse speed of opertion (may i use select with LIKE to speed up??????)


Posted by: Rtpharry on: 9/22/2009 [Member] [MVP] Bronze


You need to learn about threads. This means you can run a process in the background so your UI can still be updated.

Apparently from a little bit of research I just did there is something called BackgroundWorker which was introduced in .net 2.0 to make this easier.

If that doesnt get you what you need then you might want to research winforms threads in general.

Pramodmca09, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response