ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.ASP.Net Error: Violating the Primary Key constraint. can not insert the duplicate key into the object<p>Hi&nbsp;phonghue,</p> <p>You are trying to insert a duplicate&nbsp;value in&nbsp;dbo_Students table.</p> <p>You can set auto increment for the column and then there should never be a problem with duplicating the value, the database will take care of that.</p> <p>If you need to specify a value yourself, you'll need to write code to determine what the max value for that field is and then increment that to avoid the duplication.</p> <p>&nbsp;</p>, 23 Jul 2019 00:52:29 GMT