We think you use parameters in incorrect way. Here is small sample of using TIMESTAMP fields.
Table definition
Code: Select all
CREATE TABLE test.opt_lck (
id INT(11) NOT NULL AUTO_INCREMENT,
f_char VARCHAR(45),
f_timestamp TIMESTAMP(0) default 'CURRENT_TIMESTAMP',
PRIMARY KEY (id)
)
Update command text
Code: Select all
UPDATE
test.opt_lck
SET
f_char = :f_char,
f_timestamp = now()
WHERE (id = :orig_id) and (f_timestamp = :orig_timestamp);
Parameters created with DataAdapter designer
Code: Select all
updateCommand.Parameters.Add(new CoreLab.MySql.MySqlParameter("f_char", CoreLab.MySql.MySqlType.VarChar, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "f_char", System.Data.DataRowVersion.Current, null));
updateCommand.Parameters.Add(new CoreLab.MySql.MySqlParameter("orig_id", CoreLab.MySql.MySqlType.Int, 1, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "id", System.Data.DataRowVersion.Original, null));
updateCommand.Parameters.Add(new CoreLab.MySql.MySqlParameter("orig_timestamp", CoreLab.MySql.MySqlType.TimeStamp, 19, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "f_timestamp", System.Data.DataRowVersion.Original, null));
Note that orig_id and orig_timestamp parameters have Original DataRowVersion.