private void button1_Click(object sender, EventArgs e) { con.Open(); OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; string a = "amrita"; string b = "akshay"; string name = textBox1.Text; string pass = textBox2.Text; if (a == name & b == pass) { MessageBox.Show("successfull login"); Admin_home f4 = new Admin_home(); f4.Show(); } else if (a != name) { MessageBox.Show("Invalid username"); } else if (b != pass) { MessageBox.Show("Invalid password"); } if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show(" Field left blank!!"); } con.Close(); }
private void hOMEToolStripMenuItem1_Click(object sender, EventArgs e) { Admin_home ad = new Admin_home(); ad.Show(); }