UpdateRowSource.FirstReturnedRecord not working on .Net 2.0 using System.Data.OracleClient

R

Rich Baker

I have a project that has been upgraded from .Net 1.1 to 2.0 and I
cannot get the UpdateRowSource.FirstReturnedRecord of the InsertCommand
to work correctly using the OracleClient. It works correctly on 1.1 and
the DataSet is updated correctly after a DataAdapter.Update, but
although the insert happens to the database on 2.0, the DataSet is not
updated.

The InsertCommand is a PL/SQL stored procedure as follows

PROCEDURE insert_orders
( p_b IN INTEGER,
p_c IN VARCHAR,
p_d IN NUMBER,
p_e IN INTEGER,
p_f IN INTEGER,
p_g IN VARCHAR,
p_h IN INTEGER,
p_i IN VARCHAR,
p_results OUT REF CURSOR) AS

v_currentValue NUMBER;

BEGIN

-- Insert a row to orders table
INSERT INTO orders
( b,
c,
d,
e,
f,
g,
h,
i)
VALUES ( p_b,
p_c,
p_d,
p_e,
p_f,
p_g,
p_h,
p_i);

-- Get the order_id of the inserted row using the sequence
SELECT seq_id.currval
INTO v_currentValue
FROM dual;

-- Get the inserted row as output
OPEN p_results FOR
SELECT id,
b,
c,
d,
e,
f,
g,
h,
i
FROM orders
WHERE id = v_currentValue;

END insert_orders;

The value of Id is populated during a Pre-Insert Trigger from an Oracle
Sequence.

Has anyone else encountered this problem?

Many thanks
Richard
 
R

Rich Baker

Hi,

The application is a bit too complex to post but it basically does the
following

1. I am using a strongly typed DataSet
2. create a row using the DataTable's NewRow method
3. The new row's columns are populated
4. The row is added to the DataTable using the Add'tablename'Row(row)
method

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top