private void button1_Click(object sender, EventArgs e) { this.Hide(); SelectPage mm = new SelectPage(); mm.Show(); }
private void button1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(global::Cocing_Maneger.Properties.Settings.Default.textloginConnectionString); SqlDataAdapter sda = new SqlDataAdapter("select count(*) from login where username ='******' and password='******'", conn); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { this.Hide(); SelectPage mm = new SelectPage(); mm.Show(); } else { MessageBox.Show("Please Enter Correct Username and Password", "Wrong Password and Username", MessageBoxButtons.OK, MessageBoxIcon.Error); } }