trialer
Well-known member
- Joined
- Oct 4, 2010
- Messages
- 64
- Programming Experience
- 1-3
			
				VB.NET:
			
		
		
		Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
      With DataGridView1
            For i As Long = 1 To 100
                BackgroundWorker1.ReportProgress(i)
                For Each row As DataGridViewRow In .Rows
                    Dim cmdSQL = "INSERT INTO PRODUCTS(ProductName,SupplierID,CategoryID,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder,ReorderLevel,Discontinued) VALUES ('" _
                                & row.Cells(1).Value & "', '" _
                                & row.Cells(2).Value & "', '" _
                                & row.Cells(3).Value & "', '" _
                                & row.Cells(4).Value & "', '" _
                                & row.Cells(5).Value & "', '" _
                                & row.Cells(6).Value & "', '" _
                                & row.Cells(7).Value & "', '" _
                                & row.Cells(8).Value & "', '" _
                                & row.Cells(9).Value & "')"
                    cmd = New MySqlCommand(cmdSQL, con)
                    cmd.ExecuteNonQuery()
                Next
            Next
        End With
    End SubI got a problem making the loop for the progress bar?
I can't figure it out where to put exactly the loop for progress bar.
Please help me. Thanks in advance.
 
	 
 
		 
 
		 
 
		 
 
		