Datasnap.DBClient.TCustomClientDataSet.SetProvider

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Datasnap.DBClient.pas
Datasnap.DBClient.hpp
Unit: Datasnap.DBClient
Parent: TCustomClientDataSet

Delphi

procedure SetProvider(Provider: TComponent);

C++

void __fastcall SetProvider(System::Classes::TComponent* Provider);

Description

Associates the client dataset with a provider in the same process space.

Use SetProvider to specify a local provider component that provides data to and applies updates from the client dataset. The client dataset communicates with this provider using the IAppServer interface specified by the AppServer property.

Do not call SetProvider if the client dataset already uses an internal provider component. Also, do not use SetProvider for remote providers on an application server. If the provider is not in the same process space as the client dataset, use the ProviderName property. If the provider has the same Owner as the client dataset, you can also use the ProviderName property.

The Provider parameter must be a descendant of TCustomProvider. Otherwise, SetProvider raises an exception.

Note: If you close the client dataset after assigning a provider using the SetProvider method, when you reopen the client dataset, you must call SetProvider again to reassign that provider.

See Also