Click to See Complete Forum and Search --> : Detect error encountered while running script from "osql.exe" utility?


THY02K
February 13th, 2005, 09:26 PM
How do I detect error while running script with "osql" utility?

Dim cmd As String = "osql.exe"
Dim args As String ="-S localhost -U joe -P xxx -d master -i"
Dim fullCmd As String = args + " '" + scriptfile + "'"

info = New ProcessStartInfo(cmd, fullCmd)
info.UseShellExecute = False

ps = Process.Start(info) 'Is there any way to monitor if any error encountered during script execution?
ps.WaitForExit()

Thanks in advance!