You can use Last_Insert_ID() function to get the last auto increment id. What I do is add the extra query to my command like this
MySqlCommand cmd = new MySqlCommand("INSERT INTO tbl_student(name,marksObtained,class,section) VALUES ('Arpan',50,'10','A'); LAST_INSERT_ID();", connection);
int lastID = (int)cmd.ExecuteScalar();
Here[
^] is the reference manual link.
Hope this helps