Could use a little debugging help...
I'm trying to execute a function that updates a couple of fields in an Oracle database table. I know the SQL code is OK because I can execute it in a editor program and it works perfectly. I get an error back in my VB.NET app when I try to execute it. Here's the code:
Public Function GetNonQuery(ByVal sSQL As String, ByVal cnConn As OracleConnection) As Object
Try
Dim oResult As Object
Dim dcDataCmd As OracleCommand = New OracleCommand()
dcDataCmd.Connection = cnConn
dcDataCmd.CommandType = CommandType.Text
dcDataCmd.CommandText = sSQL
oResult = dcDataCmd.ExecuteNonQuery
Return oResult
Catch myErr As Exception
End Try
End Function
The code fails on the ExecuteNonQuery command, I'm not sure yet what the error code is (when I figure it out I'll post it). Can anyone tell me what is wrong here, why doesn't this work? It seems very straightforward...
Thanks
CraigHartz
CraigHartz
I'm trying to execute a function that updates a couple of fields in an Oracle database table. I know the SQL code is OK because I can execute it in a editor program and it works perfectly. I get an error back in my VB.NET app when I try to execute it. Here's the code:
Public Function GetNonQuery(ByVal sSQL As String, ByVal cnConn As OracleConnection) As Object
Try
Dim oResult As Object
Dim dcDataCmd As OracleCommand = New OracleCommand()
dcDataCmd.Connection = cnConn
dcDataCmd.CommandType = CommandType.Text
dcDataCmd.CommandText = sSQL
oResult = dcDataCmd.ExecuteNonQuery
Return oResult
Catch myErr As Exception
End Try
End Function
The code fails on the ExecuteNonQuery command, I'm not sure yet what the error code is (when I figure it out I'll post it). Can anyone tell me what is wrong here, why doesn't this work? It seems very straightforward...
Thanks
CraigHartz
CraigHartz