'UPDATE [mytable] SET [field1] = @field1, [field2] = @field2
WHERE (([PrimaryKey] = @Original_PrimaryKey)
AND ((@IsNull_field1 = 1 AND [field1] IS NULL) OR ([field1] = @Original_field1))
AND ((@IsNull_field2 = 1 AND [field2] IS NULL) OR ([field2] = @Original_field2))
'@field1=123, @field2='newStringValue',
@IsNull_field1=0, @Original_field1=1,
@IsNull_fiels2=0, @Original_field2='oldStringValue'
now you can compare the value in the database with the Original_Value from the command and find out which values are differnet - they are blocking.
to do this automatically, you have to catch the exception, get the modified records of the dataset you tried to save, read them again in another dataset and compare those two datasets - (original values)
No comments:
Post a Comment