SqlDataAdapter.Update and StoredProc output

  • Thread starter Thread starter Paschalis Pagonidis
  • Start date Start date
P

Paschalis Pagonidis

Hi,

I have a stored procedure that inserts a record into a
table & returns the record's PK as an output parameter.

Is there a clever way to update each DataRow during or
after Update() and set the PK with the value returned by
the procedure?

thanks,
Pascal
 
I think I found a solution.

I added an output SqlParameter to the Insert SqlCommand of
the adapter and made it point to PK field. Just after
Update() executes the stored procedure internally for each
row, I think it automatically sets the PK field with the
value the procedure returned (and "catched" by the
parameter output which set the field).

Am I wrong on that (because I'm not sure yet)?

I've pointed out this, after having the RowChanged event
raised during save.

thanks,
Pascal
 
Back
Top