Public Function GenerateUniNo(ByVal Length As Integer) As String Randomize() Dim ValidChars As String ValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" Dim i, x As Integer Dim password As String = "" For i = 1 To Length x = Int(Len(ValidChars) * Rnd() + 1) password = password & Mid(ValidChars, x, 1) Next GenerateUniNo = password End Function
Dim dr = dbCommE.ExecuteReader() If dr.HasRows Then txtUniNo.Text = GenerateUniNo (4) If dr(0) = Trim(txtUniNo.Text) Then txtUniNo.Text = "" txtUniNo.Text = GenerateUniNo (4) End If End If
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE