This content has been marked as final. Show 4 replies
When I run the query...
UPDATE TBLICPMETHODS SET Frequency = 'Ag 328.068', Calibration = .5, QCValue = .5
WHERE Frequency = 'Ag 328.068' AND MethodNumber = 1
in SQL Navigator is works fine. I'm thinking the data types aren't correct. Can someone help me line up my OLEDB data types to Oracle data types...
Oracle Table Types...
OLEDB Data Types...
Are these the wrong OLEDB data types to use for those oracle data types???
Incidentally, if I just execute my sql like this...
Dim sSQL As String = _
"UPDATE TBLICPMETHODS SET Frequency = '" & sFrequency & "', " & _
"Calibration = " & sCalibration & ", QCValue = " & sQCValue & "" & _
" WHERE Frequency = '" & Session("EditFrequency") & "' AND MethodNumber = " & ddlMethods.SelectedValue
instead of using the cmdCommand.Parameters.Add method IT WORKS!!
So I'll go ahead and use that but I really would like to know what I was doing wrong. I tried quite a few different data type permutations to no avail.
I am having the same problem. I am trying to call Update(dset, "tablname")
When I call dset.HasChanges() it is true. If I call GetChanges() I get a row that needs to be updated. I have changed my update query to only one value. Since I need to supply the update parameters map to the dataset, I can't just build a string with the values. The same code works connecting to Access. What is the deal with Oracle?
The program is vb.net 1.1, the Oracle is 9i.
The problem is that OLEDB doesn't support named parameters.
If you replace the @parameter names with question marks in the SQL statement
"UPDATE TBLICPMETHODS SET Frequency = @Frequency, " & _
"Calibration = @Calibration, QCValue = @QCVAlue"
"UPDATE TBLICPMETHODS SET Frequency = ?, " & _
"Calibration = ?, QCValue = ?"
and add the parameters in the correct order, it should work. The parameter declaration are still the same (@ symbol optional)
Otherwise you could try switching to the Oracle.NET provider.
The trick with it though is that you have to replace the @ with a : in the sql statement and leave it out of the parameter name
"UPDATE TBLICPMETHODS SET Frequency = :Frequency, " & _
"Calibration = :Calibration, QCValue = :QCVAlue" & _
Dim prmQCValue As OracleParameter = _
New OracleParameter("QCValue", OracleType.Double, 75)