how to retrieve the new identity field value with save

Posts   
 
    
dianec
User
Posts: 11
Joined: 16-Mar-2007
# Posted on: 26-Apr-2007 22:39:01   

I need to be able to retrieve the new identity field value once the a record has been inserted into the table. Could you give me an code example. thanks

Also, when there is an error in updating or saving a record, and the entitity save() return false, where do I get the error message???

thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Apr-2007 09:18:06   

I need to be able to retrieve the new identity field value once the a record has been inserted into the table.

If it's the PK it will be automatically available in the entity after the save call, if it's not the PK then you should pass true as the Refetch parameter to the Save method.

Also, when there is an error in updating or saving a record, and the entitity save() return false, where do I get the error message???

Discussed here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=5715