10
Answers

Primary key duplication ? using ADO.net

SUNIL GUTTA

SUNIL GUTTA

11y
1k
1
Hi

Well i tried to insert records into DB from created web-form . I used string.format(insert statement ) & Data reader :)


Initially 1st insert is going successfully but second insert popping some dam error like below 


Violation of PRIMARY KEY constraint 'PK_studentform'. Cannot insert duplicate key in object 'dbo.studentform'.
The statement has been terminated.







I maintained uniqueness in Pk column but why am i facing this ??


Please help me 



Answers (10)