G
Guest
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.SqlConnection("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.SqlCommand
cmd.Connection = cn
cmd.CommandText = ProcToExec
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@pRESULT", SqlDbType.Int)
cmd.Parameters(0).Direction = ParameterDirection.Output
MessageBox.Show(ProcToExec)
Try
cmd.ExecuteNonQuery()
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.SqlConnection("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.SqlCommand
cmd.Connection = cn
cmd.CommandText = ProcToExec
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@pRESULT", SqlDbType.Int)
cmd.Parameters(0).Direction = ParameterDirection.Output
MessageBox.Show(ProcToExec)
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
sqlCnError = ("Error: Could not execute procedure")
End Try
cmd.Dispose()
cn.Close()
cn.Dispose()