Generating a unique random number

Unficevisse

New Member
I am entering student id as a randon number into the DB \[code\] int num = r.Next(1000); Session["number"] = "SN" + (" ") + num.ToString();\[/code\]But is there any chance of getting a duplicate number?How can i avoid this?
 
Back
Top