In Visual studio 2012 datagrid view when I delete a row the next row should automatically be assigned the deleted row Id. My data resides in My sql . kindly help me with the code. Example if I have 5 rows 1,2,3,4 ,5 and delete no. 3 row the no. 4 row should become no. 3 and no. 5 should become no. 4 ( auto increment is not working). kindly help me with code and the procedure.