S
standish22
I want to programmatically capture an error that is done from a Shell
command in VB.Net code.
What I have is a Test.sql file that looks like
---------------------------------------------------
select * from Table1
GO
select * from Table2
GO
----------------------------------------------------
Then in my vb.net code I have:
Private Sub btnRun_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnRun.Click
Shell("osql -U UserID1 -P Password1 -S MyServer" & _
"-d MyDatabase -i C:\Test.sql -o C:\Output.sql", _
AppWinStyle.NormalFocus)
End Sub
Is there anyway inside the VB.Net code to capture an error if it
occurs. If I'm required to change my Test.sql file, that is fine. I
have access to this file created.
I'm wanting to run a series of these commands (some may be
updates/creates/etc) But if there is an error, I want to stop.
Thanks...
command in VB.Net code.
What I have is a Test.sql file that looks like
---------------------------------------------------
select * from Table1
GO
select * from Table2
GO
----------------------------------------------------
Then in my vb.net code I have:
Private Sub btnRun_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnRun.Click
Shell("osql -U UserID1 -P Password1 -S MyServer" & _
"-d MyDatabase -i C:\Test.sql -o C:\Output.sql", _
AppWinStyle.NormalFocus)
End Sub
Is there anyway inside the VB.Net code to capture an error if it
occurs. If I'm required to change my Test.sql file, that is fine. I
have access to this file created.
I'm wanting to run a series of these commands (some may be
updates/creates/etc) But if there is an error, I want to stop.
Thanks...