Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            connection = new MySqlConnection("server=localhost;username=root;database=uvd;password=qwerty1234");
            connection.Open();
            String query = "select password from worker where w_no='" + textBox1.Text + "'";

            cmd = new MySqlCommand(query, connection);
            mdr = cmd.ExecuteReader();
            if (mdr.Read())
            {
                if (textBox2.Text == mdr.GetString("password"))
                {
                    // MessageBox.Show("Correct");
                    Form15 frm = new Form15("", "");//change this form
                    frm.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Incorrect password/ID");
                }
            }
            else
            {
                MessageBox.Show("Incorrect password/ID");
            }
            connection.Close();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form15 frm = new Form15(textBox1.Text, textBox2.Text);

            frm.Show();
            this.Close();
        }