Reputation: 325
I am using MS Access as a database for a school project. The following is my query:
public static string qry4 = "update INTERNETSETTINGS set password = @password , url = @url , databasename = @databasename , port = @port , username = @username";
It is giving me the following error: Syntax Error in Update Statement
Command.Parameters.AddWithValue("@url", urlBox.Text.ToString());
Command.Parameters.AddWithValue("@databasename", databaseBox.Text.ToString());
Command.Parameters.AddWithValue("@port", portBox.Text.ToString());
Command.Parameters.AddWithValue("@username", userBox.Text.ToString());
Command.Parameters.AddWithValue("@password", passwordBox.Text.ToString());
It is making me angry because every thing is ok and right on target but still I am getting the error, but when I remove password from query it works fine. Please Help.
Upvotes: 2
Views: 105
Reputation: 1899
Most likely, password
is a reserved keyword. Place it in braces...
update INTERNETSETTINGS set [password] = @password...
Upvotes: 2