Click here to Skip to main content
15,901,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using VB.Net 2008 and SQL server 2005 as backend.

I want to create a serial number that is like **abc/2010/01.**.In this..
1) the abc is same in all the serial no.
2) the 2010 is used from the running Year.(using date for year)
3) the 01 is a actual serial no that can be auto generated...

But how can I do this?
How can i find the maximum number for my serial number?
How can I maintain it if I delete it then all after delete serial numbers will take it's place..(there is no break in serial number on delete)?
Please help me.
Posted
Updated 4-Dec-10 2:31am
v3
Comments
JF2015 4-Dec-10 8:27am    
Edited to improve readability and fix some spelling errors.

Ok,

I can at least tell you that there is NO maximum for your serial number - you can use unlimited numbers.
Your problems seems to be the handling of the numbers. On generating a serial number you should store the year and the auto-generated number somewhere (e.g. in a database). This will help you to make sure that on deleting a serial number you don't risk creating the number again.

Try to break down your problem in simple tasks:
1. Create the numbers
2. Store the created numbers in your database or elsewhere
3. Handle deleting a serial number
 
Share this answer
 
v2
Comments
Neeil 4-Dec-10 8:50am    
@JF2015 but how can i auto genrete a serial no of this type???
Espen Harlinn 15-Jan-11 10:59am    
5+ Good answer
Select Max(sno) +1 from tbl

then after
txtbox.text="abc" & "/" & Format(now,"yyyy") & "/" & com.ExecuteScalar()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900