private void btnRegister_Click(object sender, EventArgs e) { UserDetails usr = new UserDetails(); usr.Name = txtName.Text; usr.Address = String.Format("{0},{1},{2}", txtStreet1.Text, txtStreet2.Text, txtCity.Text); usr.DOB = dtpDOB.Value.ToString("yyyy-MM-dd"); usr.Email = txtEmail.Text; usr.Password = txtPassword.Text; if (usr.AddUser(usr)) { MessageBox.Show("Successful"); } else { MessageBox.Show("Email already in user."); } }