Command builder and retrieving autoincrement values
Database
1
Posts
1
Posters
0
Views
1
Watching
-
Hi I'm creating insert command object with command builder and then adding "; SELECT SCOPE_IDENTITY() as primary_key_field" formula to CommandText property of this object. I'm also setting its UpdateRowSource property to FirstReturnedRecord. After calling update method of data adapter I do not get new primary key value. I did the same without using command builder (I've created insert command object in code "manually" and it's identical to the one which is created by the command builder) and everything seems to work fine. Does someone have any idea why retrieving autoincrement value doesn't work when I use CommandBuilder? Thanks for any clues Maciek ps. If you need to see a code example, just let me know.