Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.Net (or C#) 2008 Multi Threaded Import

I am looking to build a multi-threaded text import facility (generally CSV into SQL Server 2005) and would like to do this in VB.NET but I am not against C#. I have VS 2008 trial and just dont know where to begin. Can anyone point me in the direction of where I can look at and play with the source of a VERY simple multi-threaded application for VS 2008?

Thanks!

like image 684
Taptronic Avatar asked Dec 06 '25 04:12

Taptronic


1 Answers

This is a great article:

http://www.devx.com/DevX/10MinuteSolution/20365

In particular:

Dim t As Thread
t = New Thread(AddressOf Me.BackgroundProcess)
t.Start()

Private Sub BackgroundProcess()
   Dim i As Integer = 1
   Do While True
        ListBox1.Items.Add("Iterations: " + i)
        i += 1
        Thread.CurrentThread.Sleep(2000)
   Loop
End Sub
like image 99
nathaniel Avatar answered Dec 08 '25 19:12

nathaniel