Problems with UPDATE command
nupdDocumentID.Value + " WHERE CMID=" +
nupdDocumentID.Value, oledbcConnection);
oledbcmdCommand.ExecuteNonQuery();
This code works without trouble. It updates the table CM in a database and sets the CMID value to the value of nupdDocumentID.Value at the position where CMID equals nupdDocumentID.Value.
This does do nothing great but change the CMID value to its old value again and so there's no change (CMID works synchronious to nupdDocumentID.Value).
The problem:
When I change this syntax in any way like...
oledbcmdCommand = new OleDbCommand("UPDATE CM SET CMID=" +
nupdDocumentID.Value + ", Date=" + dtpDate.Value + " WHERE CMID=" +
nupdDocumentID.Value, oledbcConnection);
oledbcmdCommand.ExecuteNonQuery();
...then this throws an exception.
The date field is the second field of the table in the database and
requries a valid data value.
Any idea what the problem could be here?
The error message says, that the UPDATE command does not
have the right syntax.
thx!

