Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Boolean b = false;

            con.Open();

            string       s   = "select * from doctor ";
            MySqlCommand cmd = new MySqlCommand(s, con);

            MySqlDataReader d = cmd.ExecuteReader();

            while (d.Read())
            {
                string username = d["dName"].ToString();
                string password = d["dpassword"].ToString();
                if ((username == textBox1.Text) && (password == textBox2.Text))
                {
                    b = true;
                }
            }

            if (b == false)
            {
                MessageBox.Show("Invalid Click (Ok) to try again");
            }
            else
            {
                Doctor_form Dform = new Doctor_form();
                this.Hide();
                Dform.ShowDialog();
            }
            con.Close();
        }