I have a form with the following controls: TDBEdit
, TDBMemo
, TDataSource
, TClientDataSet
If the user edits the fields and then clicks a button on the form that simply calls the MyCDS.Cancel
method (to cancel the edits), the TDBEdit
fields revert to their original values, but the TDBMemo
fields are not reverted (they are set to blank values).
The TClientDataSet
is populated from a MSSQLServer 2008 database. The TDBEdit
fields are nvarchar(255)
in the database, and the TDBMemo
are nvarchar(max)
or xml
fields.
Looking at the values in the Debug Inspector (ctrl+F7, MyCDS.FieldByName('afield'), Inspect) shows the following for one of the nvarchar(max)
fields:
- DataSize = 0
- DataType = ftWideMemo
- Size = 1
This is the same for all of the nvarchar(max)
and xml
fields whether or not the underlying field has data or not.
It appears that there is an incompatibility between the nvarchar(max)
(which is treated as a ftWideMemo
) and the TDBMemo
control.
Has anyone seen issues like this before? Do you have any suggestions how to resolve it?