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.

Recommended Answers

All 4 Replies

  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.

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)

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

Welcome nirmal111.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.