Getting Identity of Inserted Record in FormView

Discussion in 'ASP .Net Web Controls' started by bigbrorpi, Apr 12, 2006.

  1. bigbrorpi

    bigbrorpi Guest

    Hi -

    I am working on code to log each transaction made through a FormView. I
    need to pass it the unique ID (row number) of the record that was just
    Updates and Deletes are easy, but I'm having problems with the Insert.

    I have this working with another FormView where I manually call the
    Insert function on an instance of a table adapter and capture the
    return value to get the SCOPE_IDENTITY returned by the query. In this
    case though, I'm trying to use a sub to handle OnItemInserted and do
    the logging from there. I can't figure out how to get the return value
    of the Insert query that was called by the ObjectDataSource. Any ideas
    as to how to do this?

    bigbrorpi, Apr 12, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.