Data Inserts using DataAdapter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

this is something very basic that i am trying to get done here.
i want to update and insert record to the database using a dataadapter which
would use Update and insert stored procs. this is easy and i can handle that,
but for inserts my stored proc returns a RowId which is generated in the
database after the record is inserted. Is there any way using a dataadapter
that when a record is inserted in the database using the insert command, i
grab the rowid value that is returned by my SP , then insert this value in
the row (in the datatable that was just inserted in the database) and return
it to the user.

I dont want to use output parameters in the insert Stored proc because it
might be possible that i might want to return more columns, the insert SP
does a "select <rowid>" as the last command in it after doing the insert of
the row.

can any one suggest how?
 
I don't see how using an Output Parameter and the ADO.Net mapping
features to return the RowID will prevent you from returning it
(again) and more columns in the last command.
 
Back
Top