Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim bgw1 As BackgroundWorker = CType(sender, BackgroundWorker)
Dim clbItems As List(Of String) = CType(e.Argument, List(Of String))
Dim item As String
Dim con As New SqlConnection(My.Settings.MyConnectionString)
con.Open()
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandTimeout = 0
cmd.CommandType = CommandType.StoredProcedure
Dim cmd1 As New SqlCommand()
cmd1.Connection = con
cmd1.CommandTimeout = 0
cmd1.CommandType = CommandType.StoredProcedure
For Each item In clbItems
bgw1.ReportProgress(0, item)
cmd.CommandText = item
cmd.ExecuteNonQuery()
cmd1.CommandText = "Execution_flag"
cmd1.Parameters.Add("@stor_proc_name", SqlDbType.NVarChar)
cmd1.Parameters("@stor_proc_name").Value = item
cmd1.ExecuteNonQuery()
Next
con.Close()
End Sub
|