Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string insertQuery = "insert into karyawan values('" + textBox3.Text + "','" + textBox1.Text + "','" + comboBox1.Text + "','" + richTextBox1.Text + "','" + textBox6.Text + "','" + textBox2.Text + "')";

            con.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, con);

            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    MessageBox.Show("Welcome , Have a Great Work!\nPlease,Login Immediately!");
                    awal f1 = new awal();
                    f1.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Data is invalid \n Please Try Again!");
                    createuser f2 = new createuser();
                    f2.Show();
                    this.Hide();
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            con.Close();
        }
Beispiel #2
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            createuser f2 = new createuser();

            f2.Show();
            this.Hide();
        }