1,105,332 Community Members

AutoNumber Alphanumeric

Member Avatar
WHchaz1027
Newbie Poster
16 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-3
 

Hi Geeks!,

I am developing a project now. My problem is how can I create a autogenerate alphanumeric in the textbox to be used as an ID of entries. I'm using VB.Net 2005 and MS SQL Server 2005 STD.

Thank you in advance. More power to this site.

Member Avatar
Lusiphur
Practically a Posting Shark
852 posts since Jun 2010
Reputation Points: 185 [?]
Q&As Helped to Solve: 134 [?]
Skill Endorsements: 4 [?]
Team Colleague
Featured
 
0
 
  1. Geeks' Lounge is not the place to be asking your code/project related questions (last I checked)
  2. You're developing a project for what purpose?
  3. You're using MS SQL and VB.Net and it never occurred to you to allow the DataBase to do the id auto-generation for you as part of it's own ID column management?
  4. Geeks' Lounge is not the place to be asking your code/project related questions

Posting to try to be helpful as opposed to just neg-voting (which I came very close to doing) and hoping a MOD just pops this thread into the right place instead of deleting it for being in the completely wrong place.

Member Avatar
codeorder
Postaholic
2,027 posts since Aug 2010
Reputation Points: 197 [?]
Q&As Helped to Solve: 390 [?]
Skill Endorsements: 10 [?]
 
0
 

I hope I'm in the proper Forum for posting the following solution. :icon_eek:

Dim myChars() As Char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
        Dim idString As String = ""
        For idLength As Integer = 0 To 9 '// this will return a 10 character ID number.
            Dim i As Integer = Rnd() * (myChars.Length - 1)
            idString &= myChars(i)
        Next
        MsgBox(idString)
Member Avatar
nirmal111
Newbie Poster
1 post since Nov 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

This code is good and i need alpha numeric in proper form like nov001 ...........and go on how to do this.kindly give ur ideas

Member Avatar
__avd
Posting Genius (adatapost)
6,703 posts since Oct 2008
Reputation Points: 1,811 [?]
Q&As Helped to Solve: 1,272 [?]
Skill Endorsements: 61 [?]
Moderator
 
0
 

Welcome nirmal111.

Please create a new thread. If you have any questions please ask. You are welcome to start your own threads.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: