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

前端 未结 3 597
鱼传尺愫
鱼传尺愫 2021-01-23 05:14

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 tr

3条回答
  •  后悔当初
    2021-01-23 05:36

    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
    

提交回复
热议问题