Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/07/2008, 12:08
Avatar de Peterpay
Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 17 años, 6 meses
Puntos: 87
Respuesta: OleDbCommand demasiado lento

Es tu enfoque tu metodo q hace las actualizaciones seguramente tiene un loop

tu solo tienes q decile a tu BackGroundWorker q empiece cuando le des click o cualquier otro evento.

YO lo pondria asi

todo esto dentro del DoWork (ojo todo tu codigo debe ser invocado o estar ene ste metodo) lo q tarda mucho.

Código:
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        Dim i As Integer = 0
        For i = 0 To dgv1.rows.count -2
            // Aqui pon todo tu codigo q hace el update
            BackgroundWorker1.ReportProgress(i)
        Next
    End Sub

Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
        ProgressBar1.Value = e.ProgressPercentage
        label.text= "articulo: " & i & " de: " & Total
    End Sub

    Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
        Label1.Text = "Proceso completado"
    End Sub
y los 2 eventos de worker completed y cancelado se quedna igual incluso el de progresschanged.
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5