When I insert data with the following code, I see the exception. What should I do?
Code:
Movie_List_DBDataContext Movie_list1 = new Movie_List_DBDataContext();
Actor act = new Actor();
act.Actor_Name = Acttxt.Text;
Movie_list1.Actors.InsertOnSubmit(act);
Movie_list1.SubmitChanges();
Exception:
Violation of PRIMARY KEY constraint 'PK_Actors'. Cannot insert duplicate key in object 'dbo.Actors'.
My table has 2 columns; ID and Name, and ID is Primary Key.