return key after inserting row

return key after inserting row

Postby AceEmbler » Tue 22 Aug 2006 11:15

Is MySqlDirect .NET provides any way to retrive primary key of just inserted row ?? If not can you please tell me best way of doing this "manually" ?

Best Regards.
AceEmbler
 
Posts: 26
Joined: Fri 04 Aug 2006 09:45

Postby Alexey » Tue 22 Aug 2006 11:53

There are several ways to do it:
    Use MySqlCommand.InsertId property.
    Execute SELECT last_insert_id() statement.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL