So, I want to insert this query into the database file:
UPDATE contas
SET nome = @nome, endereço = @endereco, serv_envio = @envio,
serv_recep = @recep, pass = @pass, user = @user,
tipo = @tipo, Seguro = @seguro
WHERE id = @id
However, every time I try to put it, I get this error:
There was an error parsing the query. [Token line number = 1, Token line offset = 101, Token in error = user]
However, after an hour trying to figure out was could be wrong, I still can’t find the error.
Also here’s the database:
Table: Contas
Columns:
- ID (Primary Integer Auto-Increase)
- Nome (text)
- Endereço (text)
- Serv_Envio (text)
- Serv_Recep (text)
- User (text)
- Pass (text)
- Tipo (Foreign Integer)
- Defeito (Boolean)
- Seguro (Boolean)
And here is the parametrization (C#):
command.Parameters.AddWithValue("@nome", tb_nome.Text);
command.Parameters.AddWithValue("@endereco", tb_mail.Text);
command.Parameters.AddWithValue("@envio", tb_envio.Text);
command.Parameters.AddWithValue("@recep", tb_recep.Text);
command.Parameters.AddWithValue("@pass", tb_pass.Text);
command.Parameters.AddWithValue("@user", tb_user.Text);
command.Parameters.AddWithValue("@tipo", cb_tipo.SelectedIndex + 1);
command.Parameters.AddWithValue("@id", idconta);
command.Parameters.AddWithValue("@seguro", seguro);
So, any help?
Thanks in advance.
João Borrego
useris a reserved word. Try:Or rename the column.