public void SignUp(string uname, string pass, string email, Sign_Up sp) { qry = "select * from blood_bank_info.sign_up_table where UserName='******' "; con = new MySqlConnection(constring); cmd = new MySqlCommand(qry, con); con.Open(); reader = cmd.ExecuteReader(); int count = 0; while (reader.Read()) { count = count + 1; } reader.Close(); if (count == 1) { MessageBox.Show("User Name already in use.Please choose another.", "Failed!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { qry = "insert into blood_bank_info.sign_up_table (UserName,Password,Email) values ( '" + uname + "', '" + pass + "','" + email + "' );"; con = new MySqlConnection(constring); cmd = new MySqlCommand(qry, con); con.Open(); reader = cmd.ExecuteReader(); while (reader.Read()) { } con.Close(); sp.Close(); Profile pro = new Profile(uname); pro.Show(); MessageBox.Show("Sign Up Complete!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button_SignUp_Click(object sender, EventArgs e) { textBox_User_Id.Clear(); textBox_Password.Clear(); Sign_Up sup = new Sign_Up(); sup.Show(); }