Jan 23, 2011 06:56 PM|selarom|LINK
I've done a lot of searching on this here but I can't seem to find anyone who has done this. I'm sure it's a common problem but I can't figure out the right keywords to search for the solution so I'm sorry if this is a duplicate.
I have a dataset where I've used the Generate Insert, Update, and Delete statements as well as the Refresh the Data Table options so that I can retrieve the last inserted ID when I'm using an ObjectDatasource.
however, when I'm handling the ObjectDataSource-Inserted method, I'm getting a 1 as a return value, which I assume is the affected rows. I don't want that, I want the ID so that I can use it in my code.
I looked at the generated code for the insert method and it is doing a SELECT after inserting, but it returns the whole row not the ID, so how can I get at this row to retrieve the value?