I am trying to insert value from code in which i want talukcode = regioncode like
model.talukcode = model.regioncode;
previously it was like
model.villagecode = MaxValue + 1;
but now i am trying
and i am getting an error
System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_ppatalukmaster'. Cannot insert duplicate key in object 'dbo.ppatalukmaster'. The duplicate key value is (3, 3). The statement has been terminated.
Is there any way to solve this error through code.