>>Try
Dim loRnd As New Random(CInt(DateTime.Now().Ticks And &HFFFFFFFF&))
>>( Casting in C# allows unchecked conversion ; VB doesn't)
>
>I replaced the line with this. It doesn't give an error. But, if I call this method twice, I end up with the same value. This is when I call it in the same second.
Just a SWAG, but have you tried
Dim loRnd As New Random()
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up