private void button2_Click(object sender, EventArgs e) { home h = new home(); this.Hide(); h.Show(); }
private void makeAuth() { string u = txtUser.Text; string p = txtPassword.Text; DataTable dt = new DataTable(); string query = "Select * from users where username = '******' and password = '******'"; db.readDatathroughAdapter(query, dt); if (dt.Rows.Count > 0) { this.Hide(); home h = new home(); h.Show(); } else { MessageBox.Show("Invalid Credentials\n Enter valid username and password", "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }