Simple Update Doesn't Work

Simple Update Doesn't Work

Postby devartSampler » Thu 13 Oct 2011 20:07

I'm testing out the devart to see how it works w/ oracle. The oraclereader works just fine but the small sample code i'm using to test the executenonquery seems to hang.

I'm using visual studio express 2010
I tried to use dbMonitor and upon using "Imports Devart.Data.Oracle.OracleMonitor" does not seem to resolve either after I've added all the devart references.

I've search unsuccessfully in the forums prior to this post. Time to stop spinning wheels. Thanks in advance for any direction.

Here's the sample code

removed try/catch


Dim strOracleConnect As String = XXXXXXXXXXXXXXXX
Dim myOracleConnection As New OracleConnection(strOracleConnect)
'Try
myOracleConnection.Open()
Dim command As OracleCommand = myOracleConnection.CreateCommand

command.CommandText = " update inventories " & _
" set " & _
" category = 'PPP' " & _
" where istock_num = '5555555' " 'it is a string
Dim rowsAffected As Integer = command.ExecuteNonQuery()
myOracleConnection.Close()
devartSampler
 
Posts: 3
Joined: Thu 13 Oct 2011 19:58

Postby Shalex » Fri 14 Oct 2011 08:15

Please install and run the dbMonitor tool:
Download link: http://www.devart.com/dbmonitor/dbmon3.exe
Documentation: http://www.devart.com/dotconnect/oracle ... nitor.html

Then execute the following code and check the database activity in dbMonitor:
Code: Select all
Imports Devart.Data.Oracle
...
Dim monitor As New OracleMonitor()
monitor.IsActive = True
Dim strOracleConnect As String = XXXXXXXXXXXXXXXX
Dim myOracleConnection As New OracleConnection(strOracleConnect)
'Try
myOracleConnection.Open()
Dim command As OracleCommand = myOracleConnection.CreateCommand

command.CommandText = " update inventories " & _
" set " & _
" category = 'PPP' " & _
" where istock_num = '5555555' " 'it is a string
Dim rowsAffected As Integer = command.ExecuteNonQuery()
myOracleConnection.Close()

Please note that the OracleMonitor class is not available in the Express edition of dotConnect for Oracle: http://www.devart.com/dotconnect/oracle/editions.html.

Notify us about the results.
Shalex
Devart Team
 
Posts: 7369
Joined: Thu 14 Aug 2008 12:44

so i'm sol w/out dbmonitor? :(

Postby devartSampler » Fri 14 Oct 2011 13:30

that explains why i VSExpress couldn't resolve the class yesterday.

Any other suggestion in trying to find out why I'm am able to get a resultset w/ oraclereader but unable to update a record with executenonquery?

the app user is able to execute tasks in sqlplus as expected.
devartSampler
 
Posts: 3
Joined: Thu 13 Oct 2011 19:58

nevermind

Postby devartSampler » Fri 14 Oct 2011 13:36

after a restart of my workstation this morning, I'm oddly enough able to execute the code and thus able to update the record w/ the very same code I was unable to yesterday.

*walks away scratching my head*

thanks anyway lol
devartSampler
 
Posts: 3
Joined: Thu 13 Oct 2011 19:58


Return to dotConnect for Oracle