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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.