Data Inserts using DataAdapter

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?
 
J

Jay Pondy

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.
 

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