Re: Creating a sequence...
If you want a random 6-digit number then you could use a Random object to generate numbers like this:
Code:
Random myRandom = new Random();
string randomNumber = myRandom.Next(0, 1000000).ToString().PadLeft('0', 6)
Notice that this will give you a string because an actual number can't have leading zeroes. Also note that the Random class produces a psuedo-random sequence, i.e. the same seed produces the same sequence. If you provide no seed then a system timer-based seed is used by default, so the chances of geting the same sequence twice is very slim, unless you create multiple Random objects very close together in code, so that the system timer has not advanced enough to produce a new seed. If you want more random than that then there have been various suggestions recently on the VB.NET forum. A search for "random" should lead you in the right direction. Finally, note that this produces a random number that is likely, but not guaranteed, to be unique. If you want to completely avoid repeated numbers then you would need to somehow keep track of which numbers have been used.