Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to make the Number of automatic generation by adding the Year, Number.

1/2010, 2/2010/ 3/2010, etc
Posted
Comments
Sandeep Mewara 8-Sep-10 14:09pm    
Automatic generation of what and when?
For now, based on details you have given I will say go ahead with a For loop and generate. Will that help?
OriginalGriff 8-Sep-10 14:19pm    
What are you going to use it for? What environment? Single user or multiuser? When do you need to generate it?
Edit your question and add these details, or we cannot really help you.
Baji Jabbar 8-Sep-10 14:26pm    
Did you tried to do it yourself? You can increment the number straight away and concatenate with '/' and year. But where you are facing problem? More details will be help full and please tell, till now what you done so far to get the desired result
fisCO7 8-Sep-10 17:42pm    
Numbers must be generated upon opening of the registration form.

The first recording will be filled with textbox, 1 / 2010
The second recording will be filled with textbox, 2 / 2010

....

please explain more about your question.
 
Share this answer
 
Comments
fisCO7 8-Sep-10 17:44pm    
Numbers must be generated upon opening of the registration form.

The first recording will be filled with textbox, 1 / 2010
The second recording will be filled with textbox, 2 / 2010
Creating an increasing number is easy, just Number++ a variable, then append the "/" and the year to it.

This is fairly simple stuff, check out some VB.Net starter sites, even the MS one.
 
Share this answer
 
Still the question is not clear.But from what I understood I can suggest :
If its a multiuser application , then you have to use a separate table (say ref_Reg ) reference to keep the last taken registration id ( say reg_RegId) . For the next registration increment ref_RegId in ref_Reg Table and select it, Concatenate the Id with / and the Year.

If the existing value in ref_Reg Table is 2 , then increment it to 3 and select into a string (say string refRegId )
string NewId =refRegId +" / " + DateTime.Now.Year; 
in C#

Hoping this will help you :)
 
Share this answer
 
v3

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