Thursday, February 3, 2011

Generate Random Number

The Random class defined in the .NET Framework class library provides functionality to generate random numbers. 

The Random class constructors have two overloaded forms. It takes either no value or it takes a seed value.

The Random class has three public methods - Next, NextBytes, and NextDouble. The Next method returns a random number, NextBytes returns an array of bytes filled with random numbers, and NextDouble returns a random number between 0.0 and 1.0. The Next method has three overloaded forms and allows you to set the minimum and maximum range of the random number.



                int newTicketNumber;
                int ticketnumber = Convert.ToInt32(lastTicNotextBox.Text);
                Random random =new Random();
                newTicketNumber = random.Next(ticketnumber);
                newticnomtextBox.Text = newTicketNumber.ToString();

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link. http://www.microsoft.com/download...