C# CODE generate courseid like 1001 1002.. without repeating
i need a c# code for generate one course id when one button click, id like 1000 1001 1002 in this manner with out repeating
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Shweta LodhaRank #31 · 39.8K reputationPosted Feb 2, 2014, 5:26 AM EST
You can store your initial number like 1000 in an integer variable and on every button click you can increment it by 1, if you are looking for a series.
If you want a random number starting with 1000, then you can use Random class to generate that as:
In below code: 1000 is the minimum and 5000 is the maximum. So, number will be generated between these two.