I have a piece of VB.Net code that generates a random number and this value gets inserted into a row in a table. I use.
.Dim RandomNumber As Long
RandomNumber = RandomClass.Next(1000, 99999)
.no problem ..
Now I find out they don't want use the same number twice.. so I was thinking of creating a view of the table that shows all the numbers so far that was used.. and compare the newly generated number against the view ..if it exists..generate another number..if it doesn't exist in the table..then insert the value into the row in the table..
My view is called vRandom and hold 2 values the Rowid and iRandom
Just wondering what would be the best approach codewide
Any help or insight would be much appreciated..