Example #1
0
        private void Exit_Click(object sender, EventArgs e)
        {
            this.Close();
            userhome u = new userhome();

            u.Show();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            MySqlConnection  mcon = new MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=Lms");
            MySqlDataAdapter msd  = new MySqlDataAdapter("select count(*) from user where username='******'and password='******'", mcon);
            DataTable        dt   = new DataTable();

            msd.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                userhome h = new userhome();
                h.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Pleasecheck username & password correctly");
            }
        }