Cannot insert duplicate key row in object
-
In my current application I am getting an error "Cannot insert duplicate key row in object with unique index .\r\n51062\r\nThe statement has been terminated." while trying to run the command sqlCommand.ExecuteNonQuery(); Please advice me if anyone has any idea on this.
Thanks & Regards Mishra
-
In my current application I am getting an error "Cannot insert duplicate key row in object with unique index .\r\n51062\r\nThe statement has been terminated." while trying to run the command sqlCommand.ExecuteNonQuery(); Please advice me if anyone has any idea on this.
Thanks & Regards Mishra
Well, the error message seems pretty clear to me. You are trying to insert rows which have a duplicated key in your table/database. Avoid doing that, or remove/change the key if you need duplicated values.
--------------------------- Blogging about SQL, Technology and many other things
-
In my current application I am getting an error "Cannot insert duplicate key row in object with unique index .\r\n51062\r\nThe statement has been terminated." while trying to run the command sqlCommand.ExecuteNonQuery(); Please advice me if anyone has any idea on this.
Thanks & Regards Mishra