private void pictureBox1_Click(object sender, EventArgs e) { FormMenu f2 = new FormMenu(); f2.Show(); this.Hide(); }
private void button1_Click_1(object sender, EventArgs e) { // create dataadabter OleDbDataAdapter da = new OleDbDataAdapter("select count(*) from Users where username='******' and password ='******' ", con); //create datatable DataTable dt = new DataTable(); //fill datatble da.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { FormMenu f2 = new FormMenu(); f2.Show(); this.Hide(); } else { MessageBox.Show("Invalid username or Password"); } }