title: Access Update query not changing values
body: <p>I have a database containing various users, and I need to change the value of their gender.</p>
  <p>When they register the only data added to the table <code>Users</code> is the Username and the Password leaving the gender blank.<br />
  I have a button to add other information just like the gender, I tried to use the update query, the program runs with no errors but when I open the database to see the result nothing is added/changed.</p>
  <p><strong>Table example:</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>Username</th>
  <th>Password</th>
  <th>Gender</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>usrExmpl</td>
  <td>pwdExmpl</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>What I'm trying to do is to add a value for the gender, either &quot;Male&quot; or &quot;Female&quot; to the respective user, this is what I tried:</p>
  <pre class="lang-vb prettyprint-override"><code>Dim gender As String = txtGender.txt
  Dim queryGender As String = &quot;UPDATE Users SET Gender=@Gender WHERE Username=@Username&quot;
  
  Using cmdGender= New OleDbCommand(queryGender, conn)
      cmdGender.Parameters.Add(&quot;Username&quot;, OleDbType.VarChar).Value = My.Settings.currentUser
      cmdGender.Parameters.Add(&quot;Gender&quot;, OleDbType.VarChar).Value = gender
  
      If conn.State = ConnectionState.Closed Then conn.Open()
      cmdGender.ExecuteNonQuery()
      cmdGender.Dispose()
  End Using
  </code></pre>
  <p>This gives me no errors and the table doesn't get updated either.</p>
  <p><strong>NB:</strong> <code>My.Settings.currentUser</code> is a string that contains the username of the current logged-in user and is correct and functioning like it should.</p>
  <p><strong>Edit:</strong>
  Thanks to @GSerg i fixed it, the problem was that i wasn't adding the parameters in the same order as the one in the query, i swapped them following the correct order.</p>