3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by rathanm
0

Good for you.

In what context are you trying to use the random number generator, what errors are you getting and do you want help or are you just stating that it doesnt work ?

0

If it's not random, you need to specify what rules have to be in place for generating each number. For example, is it a sequence number? A number based on the date and time? "Not random" is not helpful; the best one can offer is this:

// Generate N "not random" numbers
for (int i = 0; i < n; i++)
    Console.WriteLine(n);
0
private void Form1_Load(object sender, EventArgs e)
        {
            con.ConnectionString = "server=MANI;uid=sa;password=sql;database=pro";
            con.Open();
            cmd.Connection = con;
            string sql;
            sql = "select MAX(pno)from product=" + textBox1.Text;
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();
             if (dr.Read())
            {
                textBox1.Text = dr.GetValue(1).ToString() + 1;
            }
            else
            {
                MessageBox.Show("rer");
            }
            dr.Close();

Edited by Narue: Added code tags

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.