Click here to Skip to main content
15,894,180 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I Generate a Number in C# Pin
stancrm26-May-09 20:47
stancrm26-May-09 20:47 
GeneralRe: How do I Generate a Number in C# Pin
Mads11526-May-09 21:09
Mads11526-May-09 21:09 
GeneralRe: How do I Generate a Number in C# Pin
stancrm26-May-09 21:18
stancrm26-May-09 21:18 
GeneralRe: How do I Generate a Number in C# Pin
stancrm26-May-09 22:22
stancrm26-May-09 22:22 
AnswerRe: How do I Generate a Number in C# Pin
MumbleB26-May-09 21:41
MumbleB26-May-09 21:41 
GeneralRe: How do I Generate a Number in C# Pin
yesu prakash26-May-09 22:38
yesu prakash26-May-09 22:38 
GeneralRe: How do I Generate a Number in C# Pin
padmanabhan N27-May-09 0:14
padmanabhan N27-May-09 0:14 
AnswerRe: How do I Generate a Number in C# Pin
Rob Philpott27-May-09 0:12
Rob Philpott27-May-09 0:12 
Are you storing the information in a database? If so, get the database to create the id for you. Make the primary key (the registration number) an identity column and your registration number will be generated upon insertion to the database.

If you storing the information in some other manner, you'll need to just build a counter to increase the registration number by some amount (could be 1, could be more in order to validate a number as a valid registration number and avoid typos) each time. If this is a serious application then you'll need to make sure you do this in a common place (singleton) and that this action is threadsafe.

Regards,
Rob Philpott.

AnswerRe: How do I Generate a Number in C# Pin
jaypatel51227-May-09 0:25
jaypatel51227-May-09 0:25 
GeneralRe: How do I Generate a Number in C# Pin
J4amieC27-May-09 0:33
J4amieC27-May-09 0:33 
GeneralRe: How do I Generate a Number in C# Pin
Henry Minute27-May-09 0:48
Henry Minute27-May-09 0:48 
Questionspecify url in app.config Pin
Maddie from Dartford26-May-09 20:18
Maddie from Dartford26-May-09 20:18 
AnswerRe: specify url in app.config Pin
Colin Angus Mackay26-May-09 20:57
Colin Angus Mackay26-May-09 20:57 
GeneralRe: specify url in app.config Pin
Maddie from Dartford26-May-09 21:20
Maddie from Dartford26-May-09 21:20 
QuestionComma as Decimal Symbol creating problem Pin
Sifar - 026-May-09 19:36
Sifar - 026-May-09 19:36 
AnswerRe: Comma as Decimal Symbol creating problem Pin
Tuwing.Sabado26-May-09 19:43
Tuwing.Sabado26-May-09 19:43 
QuestionSerialize/Deserialize data class from different assemblies Pin
charian092026-May-09 19:29
charian092026-May-09 19:29 
AnswerRe: Serialize/Deserialize data class from different assemblies Pin
occcy26-May-09 20:58
occcy26-May-09 20:58 
GeneralRe: Serialize/Deserialize data class from different assemblies Pin
charian092026-May-09 23:44
charian092026-May-09 23:44 
AnswerRe: Serialize/Deserialize data class from different assemblies Pin
Giorgi Dalakishvili27-May-09 1:21
mentorGiorgi Dalakishvili27-May-09 1:21 
QuestionInformation obut BHO? Pin
Yukivi26-May-09 19:19
Yukivi26-May-09 19:19 
AnswerRe: Information obut BHO? Pin
Henry Minute27-May-09 0:49
Henry Minute27-May-09 0:49 
QuestionEDB file using C# Pin
vijaywithu26-May-09 19:10
vijaywithu26-May-09 19:10 
AnswerRe: EDB file using C# Pin
Colin Angus Mackay26-May-09 21:00
Colin Angus Mackay26-May-09 21:00 
GeneralRe: EDB file using C# Pin
vijaywithu26-May-09 23:02
vijaywithu26-May-09 23:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.