I'm having a hard time understanding this.

I get what multithreading is- allowing a program to run more than one thread to improve performance, by splitting up some of it's resources.

So I'm at the point in my app where I need to use it. I need to upload some small text files in the background while the app is running and the user won't know their stuff is being backed up via FTP.

I don't understand where to put start- I have some code I found and a couple of good tutorials explaining the process- but...

Where do I put it? For example- I have a main form. I have a button that calls a class, and in the class is FTP code to upload some small text files. So what gets the separate thread? The class? The main form? I don't get it.

Here's some code- I don't think I have this right-

Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click

        Dim load As New clsFTP
        load.UploadLogsWithFTP()
        Thread = New System.Threading.Thread(AddressOf load.UploadLogsWithFTP)
        Thread.Start()

    End Sub

Then more code in clsFTP (this isn't all the code)

Then I can't use Imports System.Threading in my main form 'cause it screws with my timers...

I dunno, I'm not getting this..

progress-

This helped-

Dim load As New clsFTP
        Thread = New System.Threading.Thread(AddressOf load.UploadLogsWithFTP)
        Thread.Start()

While rd.Read

Dim ls As New ListViewItem(rd.Item("accno").ToString())
ls.SubItems.Add(rd("classno") + "<>" + (rd("bookno")))
ls.SubItems.Add(rd("Title"))
ls.SubItems.Add(rd("author1"))
ls.SubItems.Add(rd("status"))
dim sl as string
rd1 = "select * from tb_accession where accno = '"& trim(rd.item("accno"))&"';"
Dim cmd1 As New SqlCommand(s1, DbCnn)
Dim rd1 As SqlDataReader
rd1 = cmd1.ExecuteReader
ListView1.Items.Add(ls)
End While
this is not working. it says no datareader works within one data reader.
pls help

unaiseek, for future references, start your own thread and do not spam other's threads with "your" question. Thanks and I hope this helps to get your issue taken care of.

This question has already been answered. Start a new discussion instead.