auto generate code number
-
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] .
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 -
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
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...