As per your request, shortened program as follows:
private static Random randObj = new Random(DateTime.Now);
private void simulate(ref DataRow myRow)
{
float v = 0.0F;
switch ( myRow["SIMType"].ToString())
{
case"SINE":
....
break;
case "RAND":
v = Convert.ToSingle( randObj.Next(
Convert.ToInt32(myRow["LowerBound"]),
Convert.ToInt32(myRow["UpperBound"]));
myRow["Value"] = v;
break;
case "RAMP":
....
break;
default:
break;
}
}
"Jon Skeet [C# MVP]" wrote:
FredC <Fr***@discussions.microsoft.com> wrote: After approximately 90000 calls to the Random.Next(iLowerBound, iUpperBound)
this function stops generating random numbers and returns iLowerBound.
Is this just me or is this a known problem?
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too