registration errorLHLy Huelar10yAsked Nov 3, 2016, 12:18 PM806Visual Basic .NETHow to solve this? thanks
Nitin Sontakke10y agoPosted Nov 3, 2016, 11:03 PMAre you sure there is a column named cpassword in table registration?0
LHLy Huelar10y agoPosted Nov 3, 2016, 8:47 PM this is my code for register. it has a error in cmd.ExecuteNonQuery(); part. private void btnregister_Click(object sender, EventArgs e) { if (txtpassword.Text == txtconfirmpass.Text) { SqlConnection con = new SqlConnection(@"Data Source=ACER\SQLEXPRESS;Initial Catalog=clinicappointmentdatabase;Integrated Security=True"); String str = "insert into registration(Firstname,Middlename,Lastname,Address,Gender,Birthdate,Contactnumber,Civilstatus,Occupation,Emailaddress,Username,Password,Cpassword) values('" + txtfname.Text + "', '" + txtmname.Text + "', '" + txtlname.Text + "', '" + txtaddress.Text + "', '" + txtgender.Text + "', '" + txtbdate.Text + "', '" + txtcontact.Text + "', '" + txtstatus.Text + "', '" + txtoccupation.Text + "', '" + txtemail.Text + "', '" + txtusername.Text + "', '" + txtpassword.Text + "', '" + txtconfirmpass.Text + "')"; con.Open(); SqlCommand cmd = new SqlCommand(str, con); cmd.ExecuteNonQuery(); MessageBox.Show("You are successfully registered. Thankyou!"); } else { lblerror.Show(); lblerror.Text = "Password not match!"; } }0
Nitin Sontakke10y agoPosted Nov 3, 2016, 12:25 PMUnfortunately, the most important part of the screen shot is not visible at all. Why not just paste the query you have used here? One piece of unasked advice. Please do not all of your data access code under the button click event. Not a very good practice. I suggest you create separate classes such as SiteUser, DataAccess, etc. Remember Abstraction is the key.0
Nitin SontakkePosted Nov 3, 2016, 11:03 PM
Ly HuelarPosted Nov 3, 2016, 8:47 PM
Nitin SontakkePosted Nov 3, 2016, 12:25 PM