Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register form
- private void btnRegisterRegister_Click(object sender, EventArgs e)
- {
- if (txtBoxNameRegister.Text != "" && txtBoxTelRegister.Text != "" &&
- txtBoxPasswordRegister.Text != "" && txtBoxPassCheckRegister.Text != "" &&
- txtBoxEmailRegister.Text != "" && txtBoxAddressRegister.Text != "")
- {
- if ((txtBoxPasswordRegister.Text).Equals(txtBoxPassCheckRegister.Text))
- {
- SqlConnection sqlConn = new SqlConnection(@"Data Source=HRISI-PC;Initial Catalog=CourseWorkVP;Integrated Security=True");
- sqlConn.Open();
- SqlCommand sqlComm = new SqlCommand("INSERT INTO Clients(Name, Telephone, Address, Email, Password) VALUES('" + txtBoxNameRegister.Text + "', '" +
- txtBoxTelRegister.Text + "', '" + txtBoxAddressRegister.Text + "', '" + txtBoxEmailRegister.Text + "', '" + txtBoxPasswordRegister.Text + "');", sqlConn);
- object obj = sqlComm.ExecuteNonQuery();
- MessageBox.Show("The user \"" + txtBoxNameRegister.Text + "\" has been sucessfully registered!");
- sqlConn.Close();
- }
- else
- {
- MessageBox.Show("The password didn't match!");
- }
- }
- else
- {
- MessageBox.Show("Please fill in all the fields!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement