Exemple #1
0
        private void logout_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainpage m1 = new mainpage();

            m1.ShowDialog();
        }
Exemple #2
0
        private void btn1submit_Click(object sender, EventArgs e)
        {
            if (txtusername.Text == "" || txtpass.Text == "")
            {
                MessageBox.Show("please fill mandatory fields");
            }
            else if (txtpass.Text != txtcpass.Text)
            {
                MessageBox.Show("passwords donot match");
            }
            else
            {
                con.Open();
            }
            MySqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "insert into user(firstname,lastname,reg_no,contact,address,username,password) values('" + txtfirstname.Text + "','" + txtlastname.Text + "','" + txtreg.Text + "','" + txtcontact.Text + "','" + txtaddress.Text + "','" + txtusername.Text + "','" + txtpass.Text + "')";
            cmd.ExecuteNonQuery();
            MessageBox.Show("registration successful");
            clear();
            this.Hide();
            mainpage m1 = new mainpage();

            m1.ShowDialog();
            con.Close();
        }