Is there a way to update rows which have a null value (0000-00-00 00:00:00) in a DateTime field with optimistic locking? I always get a concurrency violation error.
Regards
Dirk
Concurrency violation when updating row
In order to update rows which have null values you need to use the following syntax:This code is compartible with table `dept` (see MySQLDirect .NET demo projects).
If you use data adapters you must manually create update command with similar query.
Code: Select all
UPDATE
dept
SET
deptno = :p1,
DNAME = :p2,
LOC = :p3
WHERE
((deptno = :p4) AND ((:p5 IS NULL AND DNAME IS NULL) OR (DNAME = :p5)) AND ((:p6 IS NULL AND LOC IS NULL) OR (LOC = :p6)))
If you use data adapters you must manually create update command with similar query.