title: C# / OLE DB: Syntax Error in INSERT INTO statement
body: <p>Here's my relational database (.accdb):</p>
  
  <p>(sorry, not enough reputation, can't post image)</p>
  
  <p><a href="https://docs.google.com/file/d/0B11KxyqILxOoVFR5OFBBbEplS0k" rel="nofollow">https://docs.google.com/file/d/0B11KxyqILxOoVFR5OFBBbEplS0k</a></p>
  
  <p>Code with error:</p>
  
  <pre><code>cmd3.CommandText = "INSERT INTO Transaction ([InvoiceNum], [ItemID], [Quantity]) " +
                       "Values (?, ?, ?)";
  
  cmd3.Parameters.AddWithValue("@InvoiceNum", invoiceNumber);
  cmd3.Parameters.AddWithValue("@ItemID", itemID);
  cmd3.Parameters.AddWithValue("@Quantity", item.GetQuantity());
  
  cmd3.ExecuteNonQuery(); //ERROR: Syntax error in INSERT INTO statement
  </code></pre>
  
  <p>If I INSERT INTO Transaction2 instead, it works.</p>
  
  <p>Working code: </p>
  
  <pre><code> cmd3.CommandText = "INSERT INTO Transaction2 ([InvoiceNum], [ItemID], [Quantity]) " +
                       "Values (?, ?, ?)";
  
  cmd3.Parameters.AddWithValue("@InvoiceNum", invoiceNumber);
  cmd3.Parameters.AddWithValue("@ItemID", itemID);
  cmd3.Parameters.AddWithValue("@Quantity", item.GetQuantity());
  
  cmd3.ExecuteNonQuery(); 
  </code></pre>
  
  <p>I think the problem has something to do with 'Transaction' having relationships with 'Invoice' and 'Item'. </p>
  
  <p>Please Help!</p>