title: C# - OdbcDataAdapter.Update() results in Syntax Error
body: <p>I'm writing a program with C# to automatically insert data in a Navision database via ODBC. I am filling a DataTable-object by calling the OdbcDataAdapter.Fill() method. After changing some values, I want to update the original DB using OdbcDataAdapter.Update(). However this always results in:</p>
  
  <blockquote>
    <p>ERROR [42000] [Simba][SimbaEngine ODBC Driver]UPDATE Item SET Location = ? WHERE ((No. &lt;&lt; ??? >>= ?) AND ((? = 1 AND Location IS NULL) OR (Location = ?)))
    ERROR [42000] [Simba][SimbaEngine ODBC Driver]Syntax Error.</p>
  </blockquote>
  
  <p>This is the code:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          DataTable Item = new DataTable();
  
          OdbcConnection connection = new OdbcConnection("DSN=Navision Frank-Backup");
  
          connection.Open();
          OdbcDataAdapter adapter = new OdbcDataAdapter();
          adapter.SelectCommand = new OdbcCommand("select \"No.\", \"Location\" from Item where \"No.\" = 'AA0182'", connection);
          OdbcCommandBuilder builder = new OdbcCommandBuilder(adapter);
  
          adapter.Fill(Item);
  
          Item.Rows[0].BeginEdit();
          Item.Rows[0]["Location"] = "SW";
          Item.Rows[0].EndEdit();
  
          adapter.UpdateCommand = builder.GetUpdateCommand();
          adapter.Update(Item);
      }
  </code></pre>
  
  <p>I'm hoping someone can help me out with that.</p>
  
  <p>Edit: I just found out that if I set the update-command manually, using</p>
  
  <pre><code>adapter.UpdateCommand = new OdbcCommand("update Item set Location = 'SW' where \"No.\" = 'AA0182'");
  </code></pre>
  
  <p>It works perfectly fine. However I can't use that method because I need to change multiple records.</p>