Example #1
0
        private void btn_sign_in_Click(object sender, EventArgs e)
        {
            this.Hide();
            sign_in s2 = new sign_in();

            s2.Show();
        }
Example #2
0
        private void btn_sign_in_Click(object sender, EventArgs e)
        {
            string gen = "";

            if (rdo_male.Checked == true)
            {
                gen = "Male";
            }
            else
            {
                gen = "Female";
            }
            //MessageBox.Show("Record insert successfully.");
            if (txt_user_name.Text.Trim() != "" && txt_confirm_password.Text.Trim() != "" && txt_password.Text.Trim() != "" && txt_insti_name.Text.Trim() != "" && txt_dob.Value.ToString() != "")
            {
                if (txt_password.Text.Trim() != txt_confirm_password.Text.Trim())
                {
                    MessageBox.Show("confirm password not matching with new passsword");
                    txt_confirm_password.Focus();
                }
                else
                {
                    cmd = new SqlCommand("insert into user_registration(user_name,user_gender,user_dob,insti_name,user_password) values(@name,@gender,@dob,@insti,@password)", con);
                    con.Open();
                    cmd.Parameters.AddWithValue("@name", txt_user_name.Text.Trim());
                    cmd.Parameters.AddWithValue("@gender", gen);
                    cmd.Parameters.AddWithValue("@dob", txt_dob.Value);
                    cmd.Parameters.AddWithValue("@insti", txt_insti_name.Text.Trim());
                    cmd.Parameters.AddWithValue("@password", txt_password.Text.Trim());
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Record insert successfully.");
                    con.Close();
                    bind();
                    clear();

                    this.Hide();
                    sign_in s1 = new sign_in();
                    s1.Show();
                }
            }
            else
            {
                MessageBox.Show("Please Provide Details !");
            }
        }