Mysql
 sql >> Database >  >> RDS >> Mysql

Ottieni l'ID della riga inserita 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