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)))
End While
Return rs.ToString()
End Function

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).

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.