Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Obtenha o id da linha inserida usando C#

MySqlCommand comm = connect.CreateCommand();
comm.CommandText = insertStatement;  // Set the insert statement
comm.ExecuteNonQuery();              // Execute the command
long id = comm.LastInsertedId;       // Get the ID of the inserted item