Hi
My code below works fine to execute a SQL script.
However I need to add a progress bar to indicate progress
when the script is long and takes longer to execute.
How do I implement it?
thanks
Newbie
Public Class Form1
Public Sub ShellandWait(ByVal ProcessPath As String)
Dim objProcess As System.Diagnostics.Process
Try
objProcess = New System.Diagnostics.Process()
objProcess.StartInfo.FileName = ProcessPath
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
objProcess.Start()
'Wait until the process passes back an exit code
objProcess.WaitForExit()
'Free resources associated with this process
objProcess.Close()
Catch
MessageBox.Show("Could not start process " & ProcessPath, "Error")
End Try
End Sub
Private Sub btnInstall_Click(sender As System.Object, e As System.EventArgs) Handles btnInstall.Click
ShellandWait(lblPath.Text)
End Sub
Private Sub btnBrowse_Click(sender As System.Object, e As System.EventArgs) Handles btnBrowse.Click
Dim dlg As OpenFileDialog = New OpenFileDialog()
dlg.Filter = "SQL files | *.sql"
If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
lblPath.Text = dlg.FileName
End If
End Sub
Private Sub btnClose_Click(sender As System.Object, e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub
End Class