Developer Documentation Library > Data Model > Extending the UNICOM Intelligence Data Model > Creating a CDSC > Implementing the features of a CDSC > Implementing Can Update
 
Implementing Can Update
When the Provider modifies existing data records through the CDSC, it:
Calls CreateCommand on the Source object to get a Command object (unless it is reusing an existing Command object).
Adds bindings to the Command object for the relevant variables.
Calls MoveNext (MoveFirst, the first time) on the Command.
If the current record is the one the Provider wants to modify, it sets the Value property on the Value objects for the relevant bindings and then calls Update on the Command.
Repeats the previous two steps until the Command object's EOF property is true.
Calls Close on the Command object (unless the Provider intends to reuse it later).
If backward scrolling is supported and the Provider wants to access the data in reverse order, it uses MoveLast, MovePrevious, and BOF instead of MoveFirst, MoveNext, and EOF. For further information, see Implementing Scroll Backward.
To determine whether the current record is the one it wants to modify, the Provider might retrieve the Value property from the Value objects involved in a selection expression (such as a Where clause). These Value objects are bound to the Command along with the Value objects that the Provider is to modify.
For information about the changes required for the Source CreateCommand, DataBindings Append, Delete, and Clear, and Command Close methods, see Implementing Can Select.
Add code to the Command Update method, to store the data from the bound Value objects in the underlying data source. If your CDSC also supports Can Add, allow for the fact that Update is also used to save changes to a new record created by the Command AddNew method.
See also
CDSC interface
Implementing the features of a CDSC