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. General Programming
  3. C#
  4. auto generate code number

auto generate code number

Scheduled Pinned Locked Moved C#
databasehelp
22 Posts 7 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.
  • F FEMDEV

    i tried to put the string of the latest code in an array and parse it for int. put the integers in a integer array. then convert them to form a string of int values and add 1 to this string converted to int. but i couldn't split the initial string!!! what should be the split criteria? string would be always of form fname.lnamexxx where x could be any number 1, 99,999,9999 anything. don't need anyone to write a code just an immediate help, if possible for split criteria of the initial string[fname.lnamexx] .

    realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #21

    Why don't you just have a identity column in your table. At that point, how many instances of a name (or any column value for that matter) you have is inconsequential...

    .45 ACP - because shooting twice is just silly
    -----
    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
    -----
    "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

    1 Reply Last reply
    0
    • F FEMDEV

      i was trying to do something like this as well.. stuck with how to pass a string as seperator in split function..!! frustrating syntax error

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #22

      Lyuc is right in saying that's pretty much you're last option. But, what he didn't say is that this method will also get slower and slower as you add more and more ID's to scan. The solution works, but it isn't scalable. You may want to take this information back and say that "it can be done, but..."

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      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