private void button7_Click(object sender, EventArgs e) { gpanel gp = new gpanel(nickname_pp); gp.Show(); this.Close(); }
private void button2_Click(object sender, EventArgs e) { if (nickname_h.Text == "") { MessageBox.Show("Enter The Nickname"); return; } if (password_h.Text == "") { MessageBox.Show("Enter The password"); return; } SqlConnection con = new SqlConnection(@"Data Source=(localdb)\Projects;Initial Catalog=gamezone;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False"); con.Open(); string nickname = nickname_h.Text; string password = password_h.Text; string q1 = "select * from signup where nickname='" + nickname + "' and password='******' "; SqlCommand cmdb = new SqlCommand(q1, con); SqlDataReader sr = cmdb.ExecuteReader(); if (!sr.Read()) { MessageBox.Show("Nickname OR Password Wrong !"); return; } else { gpanel gp = new gpanel(nickname); gp.Show(); this.Hide(); } con.Close(); }