I am using this code 2 time on the same project and both tries worked, I'm wondering whats wrong on my code, my column and table is right (I copy pasted my names to be sure), and every time I try to update it, it always says syntax error on update statement
string sql = "";
sql = string.Format(@"UPDATE users_list
SET Username='{0}',Last_name='{1}',Contact_number={2},Password='{3}',Position='{4}'
WHERE ID={5}",
txt_username.Text.Trim(),
txt_userlastname.Text.Trim(),
txt_usernumber.Text.Trim(),
txt_userpassword.Text.Trim(),
cbo_position.Text,
txt_userid.Text.Trim());
crudTools.ExecuteQuery(sql); //run the query
MessageBox.Show("Records updated");
Menu frm = new Menu();
frm.Show(); //load form
this.Hide(); //hide form