Dear you are trying to update the
ID
field which you had defined
Primary Key
in you table structure.
Primary key
is always a unique and not supposed to insert a
duplicate key
and you are forcefully trying to update through a data which is already defined as a
primary key
.
Following is wrong.
delcmd.CommandText = "UPDATE AddEvent SET ID=" + grdEvents.SelectedRows[0].Cells[0].Value.ToString()+ "";
Thanks
Ashish