While I was working with Visual Basic .NET by adding a form to manage user account in my system I found an error called “Syntax error in UPDATE statement”. After figuring out what’s the cause of this error I found out that it was the name of the field that is causing the problem.
In my Users table I have the following fields:
UserID
Password
CompleteName
As you can see all of these fields are valid. The statement to save a record back to its database is:
But when I run the program and update the record, visual basic breaks at this line:
Now, looking back at what I have learned about naming convention I come to think that Password attribute is a reserved word. After changing the name of this attribute from Password to Passworda the error has gone.
This is sometimes very frustrating when you are in a hurry working with your code to meet the deadline. But this is a fact that we have to face to become a successful programmer.
The only ingredient that you need to develop is patience.