RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.SetProvider Method

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

Pascal
procedure SetProvider(Provider: TComponent);
C++
__fastcall SetProvider(TComponent * Provider);

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.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!