I have code below that will only execute half of a procedure!!!
I can execute it fine in SQLServer.
The parametars are setup the same as are the returning params for other
sProcs that run fine. I have checked everything
Why does it only execute half the proc thru .net???
Very strange.
Private Function RunExecRoutines ()
Try
cn = New SqlClient.SqlCo nnection("user id=" & UserName.Text &
";password= " & Password.Text & ";database= " & Database.Text & ";server=" &
Server.Text)
cn.Open()
Catch ex As Exception
sqlCnError = ("Error: Could not establish database connection")
End Try
cmd = New SqlClient.SqlCo mmand
cmd.Connection = cn
cmd.CommandText = ProcToExec
cmd.CommandType = CommandType.Sto redProcedure
cmd.Parameters. Add("@pRESULT", SqlDbType.Int)
cmd.Parameters( 0).Direction = ParameterDirect ion.Output
MessageBox.Show (ProcToExec)
Try
cmd.ExecuteNonQ uery()
Catch ex As Exception
sqlCnError = ("Error: Could not execute procedure")
End Try
cmd.Dispose()
cn.Close()
cn.Dispose()
I can execute it fine in SQLServer.
The parametars are setup the same as are the returning params for other
sProcs that run fine. I have checked everything
Why does it only execute half the proc thru .net???
Very strange.
Private Function RunExecRoutines ()
Try
cn = New SqlClient.SqlCo nnection("user id=" & UserName.Text &
";password= " & Password.Text & ";database= " & Database.Text & ";server=" &
Server.Text)
cn.Open()
Catch ex As Exception
sqlCnError = ("Error: Could not establish database connection")
End Try
cmd = New SqlClient.SqlCo mmand
cmd.Connection = cn
cmd.CommandText = ProcToExec
cmd.CommandType = CommandType.Sto redProcedure
cmd.Parameters. Add("@pRESULT", SqlDbType.Int)
cmd.Parameters( 0).Direction = ParameterDirect ion.Output
MessageBox.Show (ProcToExec)
Try
cmd.ExecuteNonQ uery()
Catch ex As Exception
sqlCnError = ("Error: Could not execute procedure")
End Try
cmd.Dispose()
cn.Close()
cn.Dispose()
Comment