title: background worker and threads
body: <p>i am using a background worker with a timer to call a function that has a for loop... as below :</p>
  
  <pre><code> Private Sub t_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t.Tick
          t.Enabled = False
          t.Interval = 5000
          Start()
  End Sub
  
   Sub Start()
      If frm10BckWorker.IsBusy &lt;&gt; True Then
          frm10BckWorker.WorkerReportsProgress = True
          frm10BckWorker.RunWorkerAsync()
      End If
  End Sub
  
   Private Sub frm2BckWorker_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles frm10BckWorker.DoWork
      StartSending()
  End Sub
  
   Sub StartSending()
      Try
          f.GetNumbers("JK_SP_GET_Users_TO_PROCEED", UsersBulkCnx(8))
  
          count = f.numbersTable.Rows.Count
          If count = 0 Then Exit Sub
  
          For I = 0 To count - 1
  
              Id = Trim(f.GetReaderValue(f.numbersTable.Rows(I).Item("ID")))
              MO = Trim(f.GetReaderValue(f.numbersTable.Rows(I).Item("MO")))
              FamilyName = Trim(f.GetReaderValue(f.numbersTable.Rows(I).Item("FamilyName")))
              CName = Trim(f.GetReaderValue(f.numbersTable.Rows(I).Item("ContactNAme")))
              ImageUrl = Trim(f.GetReaderValue(f.numbersTable.Rows(I).Item("ImageUrl")))
  
              If Not f.InsertUsers(MO, FamilyName, CName,UsersCnx(8)) Then
                  PROC = -1
              End If
  
              f.DeleteBulk(Id, BulkNbrCnx(8))
              f.InsertHistory(MO, FamilyName, CName,ImageUrl, UsersBulkCnx(8))
  
          Next
      Catch ex As Exception
          f.WriteToText("StartSending", ex.ToString)
      End Try
  End Sub
  </code></pre>
  
  <p>what i need is to run in background this function <code>f.InsertHistory</code> that i call in the for loop and keep the loop running at the time without waiting for this function to end to go to the next record in the loop,</p>
  
  <p>any suggestions please?</p>