473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

DB operation problem

Hi everybody.

A timer calls the following procedure mySub() to check if two values
(in an Oracle DB table) had modified.
Problem is, values stored into c1_read and c2_read are NOT the actual
values in the database fields.
Can anybody help? THX
....
Dim myId As New DataSet("myId")
....

Private Sub mySub()

Dim myQuery As String = "select c1, c2 from T where myParam = 1"
Dim mycmd As New OracleCommand(myQuery, con)
mycmd.CommandType = CommandType.Text
Dim adapt As New OracleDataAdapter(mycmd)

Try
mycmd.ExecuteNonQuery()
adapt.Fill(myId, "tab_myId")
c1_read = CStr(myId.Tables("tab_myId").Rows(0).Item("c1"))
c2_read = CStr(myId.Tables("tab_myId").Rows(0).Item("c2"))
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mycmd = Nothing
End Try
End Sub

Nov 21 '05 #1
2 976

"N! Xau" <nx**@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi everybody.

A timer calls the following procedure mySub() to check if two values
(in an Oracle DB table) had modified.
Problem is, values stored into c1_read and c2_read are NOT the actual
values in the database fields.
Can anybody help? THX
...
Dim myId As New DataSet("myId")
...

Private Sub mySub()

Dim myQuery As String = "select c1, c2 from T where myParam = 1"
Dim mycmd As New OracleCommand(myQuery, con)
mycmd.CommandType = CommandType.Text
Dim adapt As New OracleDataAdapter(mycmd)

Try
mycmd.ExecuteNonQuery()
adapt.Fill(myId, "tab_myId")
c1_read = CStr(myId.Tables("tab_myId").Rows(0).Item("c1"))
c2_read = CStr(myId.Tables("tab_myId").Rows(0).Item("c2"))
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mycmd = Nothing
End Try
End Sub

So what, exactly, is being stored in c1_read and c2_read (presumably
declared as String elsewhere?) when this code executes?

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 21 '05 #2
Peter van der Goes:
So what, exactly, is being stored in c1_read and c2_read (presumably
declared as String elsewhere?) when this code executes?

Yes Peter c1_read and c2_read are class scope variables declared as
String.
They are supposed to store the result of an UPDATE query. Fields c1 and
c2 in DB are actually updated, I can see it with Toad. But if I debug,
c1_read and c2_read still have the values they had before the Update.
thanks for help
N! Xau

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marcus | last post by:
Hi I have a very complex sql query and a explain plan. I found there is a full table scan in ID=9 9 8 TABLE ACCESS (FULL) OF 'F_LOTTXNHIST' (Cost=84573 Card=185892...
1
by: Nico | last post by:
Hi! I use Windows XP and Access 2002 (XP) SP2 (not SP3) My company has not upgraded to SP3. My problem: -I have a form "F_BOMs" -in this form, i have a sub form called "SF_BOMs" -the sub-form...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
4
by: Tom | last post by:
I have a VB.NET framework 1.1 application that I am installing on my user's workstation. It works fine on EVERY machine except for one - on this one machine it generates a 'Overflow or underflow in...
0
by: relaxedrob | last post by:
Hi All, I have a portType such as this: <portType name="CMLeJobSoapGetEmpBrand"> <operation name="EJobGetEmpBrand"> <input message="tns:EJobEmpBrdReq" name="EJobEmpBrdReq"/> <output...
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
6
by: Cerebrus99 | last post by:
Hi all, I'm making a Windows application that does some lengthy retrieval operations from a database and possibly from a internet resource. I want to show that the operation is going on, by...
3
by: Don Hanlen | last post by:
IDLE internal error in runcode() Traceback (most recent call last): File "C:\PYTHON25\lib\idlelib\rpc.py", line 235, in asyncqueue self.putmessage((seq, request)) File...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
3
by: Sakhtkoosh | last post by:
I have written a program in C environment. I need to do operation on codes with more than 64 elements whose values are 0 and 1. At first, I simulated it with an array in 2 dimension(n*m) but after...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.