Threading

B

Brad

I need to learn about threads and threading. I currently have a process
that is pulling 10 to 12 thousand records from the AS400 and formatting the
data then storing into a SQL server. This process is taking just over one
hour and I would like a progress bar or something to show that it is
actually working and I guess this would be done using threads.

Can somebody give me a link to some good starter information on threads

If it makes a difference, I am using VB .Net.

Thanks,

Brad
 
C

Carlos J. Quintero [.NET MVP]

First of all, if you are using a single thread you can still provide a
progress bar. I suppose that you have a loop pulling records from a
recordset. If you know in advance the number of records, you just update the
progress bar when there is a 1% of variation. You use the Refresh method or
similar to repaint the progressbar, or maybe a
System.Windows.Forms.Application.DoEvents statement.

Threads are used to make the UI more responsive and allow cancellation if
the above is not enough. Here you have a tutorial:

Safe, Simple Multithreading in Windows Forms, Part 1
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms06112002.asp

Safe, Simple Multithreading in Windows Forms, Part 2
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms08162002.asp

Safe, Simple Multithreading in Windows Forms, Part 3
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms01232003.asp


--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 

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