public void button3_Click(object sender, EventArgs e) { Random random = new Random(); string i = random.Next(10000, 99999).ToString(); string j = random.Next(10000, 99999).ToString(); command.CommandText = "select max(Nom_Cheka) from Chek"; Registry_Class.sqlConnection.Open(); int maximum = (int)command.ExecuteScalar(); Registry_Class.sqlConnection.Close(); maximum++; num = maximum; inn = Convert.ToInt64(i + j); procedure.spAdd_Chek(num, inn.ToString(), (int)comboBox1.SelectedValue, (int)numericUpDown1.Value, comboBox2.SelectedValue.ToString()); }