Public Function ExecuteNonQuery(ByVal cmd As OracleCommand) As Integer
' no of affected rows ...
Dim affectedRows As Integer = -1
' execute the command ...
Try
' open connection ...
cmd.Connection.Open()
Catch ex As Exception
MsgBox("Unable to establish a connection to database." & ex.ToString, MsgBoxStyle.Critical)
Exit Function
End Try
Try
' execute command ...
'affectedRows = cmd.ExecuteNonQuery()
affectedRows = cmd.ExecuteNonQuery()
Catch ex As OracleClient.OracleException
If CInt(ex.Code) = CInt(1) Then
Return -2
End If
Catch ex As Exception
' rethrow error ...
'Dim cfrErr As New CFR_Errors("Data_Access_Class","ExecuteNonQuery", ex)
Throw New Exception(ex.InnerException.ToString, ex)
Finally
cmd.Connection.Close()
End Try
Return affectedRows
End Function
How can I use Oracle.ManagedDataAccess to execute my query async? We are changing our database to AWS and it may introduce latency,