Datasnap.DBClient.TCustomClientDataSet.SetOptionalParam
Delphi
procedure SetOptionalParam(const ParamName: string; const Value: OleVariant; IncludeInDelta: Boolean = False); virtual;
C++
virtual void __fastcall SetOptionalParam(const System::UnicodeString ParamName, const System::OleVariant &Value, bool IncludeInDelta = false);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | TCustomClientDataSet |
Description
Saves a custom parameter with the data packet.
You can add custom information to a data packet using the SetOptionalParam method. This information is saved with the data packet when it is saved to a file or stream, and copied with the value of the Data property. For example, by setting a parameter in the OnGetData event of the provider, application servers can include custom information with the data that is sent to client applications. Call GetOptionalParam to retrieve the custom information from the data packet.
The ParamName
parameter specifies the name under which the custom information is stored. It can be any value except one of the following:
UNIQUE_KEY |
DEFAULT_ORDER |
CHANGE_LOG |
SERVER_COL |
CONSTRAINTS |
DATASET_CONTEXT |
DATASET_DELTA |
LCID |
BDERECORD_X |
TABLE_NAME |
MD_FIELDLINKS |
UPDATEMODE |
The Value
parameter is an OleVariant that represents the custom information.
The IncludeInDelta
parameter specifies whether the parameter is also stored with the Delta property. By including the parameter in the Delta property, it is sent along with updates to the provider. The provider can then retrieve this information using the GetOptionalParam method of the client dataset passed as a parameter to an OnUpdateData event handler.
Note: Do not confuse the optional data saved by this method with the Params property.