Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Cannot insert duplicate key row in object

Cannot insert duplicate key row in object

Scheduled Pinned Locked Moved Database
databasehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Ballita
    wrote on last edited by
    #1

    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

    A B 2 Replies Last reply
    0
    • B Ballita

      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

      A Offline
      A Offline
      Alsvha
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • B Ballita

        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

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #3

        You allready got answer from error message.


        I Love T-SQL "Don't torture yourself,let the life to do it for you."

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups