private void label13_Click(object sender, EventArgs e) { menu frm = new menu(); frm.Show(); this.Hide(); }
private void label3_Click(object sender, EventArgs e) { connection.Close(); connection.Open(); MySqlDataAdapter sda = new MySqlDataAdapter("select * from user where username='******'and password='******' ", connection); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count > 0) { menu frm = new menu(); frm.Show(); this.Hide(); } else { errorProvider1.Clear(); string username, password; username = textBox1.Text; password = textBox2.Text; if ("admin".ToString() == username && "nibm1234".ToString() == password) { admin frm = new admin(); frm.Show(); this.Hide(); } else { errorProvider1.SetError(textBox1, "Invalid Username or Password"); } } connection.Close(); }