private void Button4_Click(object sender, EventArgs e) { Home_Page hp = new Home_Page(); hp.Show(); this.Close(); }
private void HomeButton_Click(object sender, EventArgs e) { Home_Page hp = new Home_Page(); hp.Show(); this.Hide(); }
private void SignInButton_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-4UE5J5G\RAIHANSQL;Initial Catalog=Raihan_Database;Integrated Security=True;Pooling=False"); string str = "select name,password from info where name = '" + nameText.Text + "' and password = '******'"; user = nameText.Text; password = passwordText.Text; SqlCommand cmd = new SqlCommand(str, con); SqlDataAdapter sd = new SqlDataAdapter(str, con); DataTable dta = new DataTable(); sd.Fill(dta); if (dta.Rows.Count > 0) { this.Hide(); Home_Page hp = new Home_Page(); hp.Show(); } else { MessageBox.Show("Password or Username is not correct !!!"); } }