Link to home
Start Free TrialLog in
Avatar of D Patel
D PatelFlag for India

asked on

ASP.NET : Generate Unique Number of length 4 alphanumeric length where first character always start with alphabet

Hi EE,

I need help in generating the Unique Number of 4 character length.

Criteria is as follows :
  1. String will always start with alphabet
  2. Another 3 characters will be a combination of alphabets (A-Z) and digits (0-9)
  3. Once the number generated it could not be repeat

A001, A999, ZD01, DA9P, SXS8 etc...

I need to write a logic for the same in my ASP.NET (VB.NET) based web application.

Please provide a direction.

D Patel
Avatar of Dorababu M
Dorababu M
Flag of India image

Once the number generated it could not be repeat are you storing the generated number some where?
Avatar of D Patel


Yes in MySQL table
thinking to have a stored procedure for data insertion and then build the logic for your field accordingly there?

then in your VB.NET program, you can call that stored procedure for data insertion.
Avatar of D Patel


Can you please brief about it more Ryan Chong?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of D Patel


Thanks for your support.