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. Web Development
  3. ASP.NET
  4. How to update a unique id

How to update a unique id

Scheduled Pinned Locked Moved ASP.NET
announcementtutorialquestion
3 Posts 2 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.
  • X Offline
    X Offline
    xdavidx
    wrote on last edited by
    #1

    Im writing a small news posting system for my site and I've run into a small snag. I want each post to have a unique id but im not sure how to keep it unique. Is there an easy to find out what the last postid entered into my table was? That way I can just add 1 to the number when I go to store a new post. Also, is there another way to do this? Am I missing something? -- modified at 15:34 Friday 9th June, 2006

    C 1 Reply Last reply
    0
    • X xdavidx

      Im writing a small news posting system for my site and I've run into a small snag. I want each post to have a unique id but im not sure how to keep it unique. Is there an easy to find out what the last postid entered into my table was? That way I can just add 1 to the number when I go to store a new post. Also, is there another way to do this? Am I missing something? -- modified at 15:34 Friday 9th June, 2006

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Why not make the ID column an IDENTITY column, that was the database will automatically create an id for you.


      "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

      X 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Why not make the ID column an IDENTITY column, that was the database will automatically create an id for you.


        "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

        X Offline
        X Offline
        xdavidx
        wrote on last edited by
        #3

        *smacks head* Thank 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