G
Guest
I have written a VB.Net application which, on start up, creates a database by
running numerous .SQL files using the OSQL utility. This is the code i'm
using in VB.Net to run the scripts:
Dim proc As New Process
proc.StartInfo.UseShellExecute = True
proc.StartInfo.FileName = "osql"
proc.StartInfo.Arguments = " -E -i C:\SQLScript.SQL"
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal
proc.Start()
I checked the proc.ExitCode value, but unfortunately, this doesn't seem to
tell you whether the script ran successfully or not. It always returns a 0,
which indicates success.
Can anyone tell me if there is a way which i could run the script from
VB.Net and work out if there were errors or not?
Thanking you in advance!
running numerous .SQL files using the OSQL utility. This is the code i'm
using in VB.Net to run the scripts:
Dim proc As New Process
proc.StartInfo.UseShellExecute = True
proc.StartInfo.FileName = "osql"
proc.StartInfo.Arguments = " -E -i C:\SQLScript.SQL"
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal
proc.Start()
I checked the proc.ExitCode value, but unfortunately, this doesn't seem to
tell you whether the script ran successfully or not. It always returns a 0,
which indicates success.
Can anyone tell me if there is a way which i could run the script from
VB.Net and work out if there were errors or not?
Thanking you in advance!