Page 1 of 1

return key after inserting row

Posted: Tue 22 Aug 2006 11:15
by AceEmbler
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.

Posted: Tue 22 Aug 2006 11:53
by Alexey
There are several ways to do it:
  • Use MySqlCommand.InsertId property.
    Execute SELECT last_insert_id() statement.