private void Button3_Click(object sender, EventArgs e) { this.Hide(); ADMIN_LOGIN M = new ADMIN_LOGIN(); M.Show(); }
private void Button1_Click(object sender, EventArgs e) { string connection = CommonMethods.GetConnectionString(); SqlConnection con = new SqlConnection(connection); SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) from addinguser where password='******' and username ='******'", con); DataTable dt = new DataTable(); sda.Fill(dt); if (textBox2.Text == "mayank" && textBox1.Text == "mayank123") { MessageBox.Show("ADMIN LOGIN SUCCESSFUL"); this.Hide(); ADMIN_LOGIN a = new ADMIN_LOGIN(); a.Show(); } else if (dt.Rows[0][0].ToString() == "1") { MessageBox.Show("LOGIN SUCCESSFUL"); this.Hide(); SECOND ss = new SECOND(); ss.Show(); } else { MessageBox.Show("INVALID USERNAME OR PASSWORD"); } }