private void button6_Click(object sender, EventArgs e) { this.Hide(); FormAdmin mm = new FormAdmin(); mm.Show(); }
private void button1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(@"Data Source = HARUMYX; Initial Catalog = AKBSHOP48; Integrated Security = True; Connect Timeout = 30"); SqlDataAdapter sda = new SqlDataAdapter("select count(*) from User_IDN where U_UserName ='******' and U_Password='******'", conn); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { if (UsID.Text == "GG") { this.Hide(); FormAdmin mm = new FormAdmin(); mm.Show(); } else { this.Hide(); Formindex mm = new Formindex(UsID.Text); mm.Show(); } } else { MessageBox.Show("please enter correct username and password", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error); } }