Hello pals,am tring to update my users table but cannot it cannot update.Can someone please tell me whats wrong with this code below.I cannot update
Dim con3 As New SqlConnection("Data Source=shah-PC\SQLEXPRESS;Initial Catalog=College;Integrated Security=True")
con3.Open()
Dim com3 As New SqlCommand("Update Registration set Firstname=@fnme,Lastname=@lnme,Age=@age,Password=@password,Campus=@campus,Telephone=@telephone from Registration where Username='" & Application("Username") & "'", con3)
com3.Parameters.AddWithValue("@fnme", Tfnme4.Text)
com3.Parameters.AddWithValue("@lnme", Tlnme4.Text)
com3.Parameters.AddWithValue("@age", Tage4.Text)
com3.Parameters.AddWithValue("@password", Tpassword4.Text)
com3.Parameters.AddWithValue("@campus", Tcampus4.Text)
com3.Parameters.AddWithValue("@telephone", Tphone4.Text)
If (com3.ExecuteNonQuery) Then
Labeluser.Text = "Profile Updated Succesfully"
Else
Labeluser.Text = "Profile Update Unsuccesfull"
End If
End Sub
Mark as answer if satisfied