for generating random number use random class for that. see below Example which gives you some idea how to generate Random Number.
Private Function GenerateRandomString(length As Integer) As String
Dim charPool As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Dim rs As New StringBuilder()
Dim rnd As New Random()
While System.Math.Max(System.Threading.Interlocked.Decrement(length),length + 1) > 0
rs.Append(charPool(CInt(rnd.NextDouble() * charPool.Length)))
HELP I NEED TO GENERATE A RANDOM ID FOR MY EXAM...
NEED TO GET THE FIRST 3 LETTERS OF THE FIRST NAME....How do I do this?been searching for hours..
Just as simple as waqasaslammmeo explained!! Use Substring() method.
1st number inside brackets is starting index (in your case is 0, becuase you want to start from beginning)
2n number is th lenght if the string (3 in your case).