Hi,
Is it possible submit 1 request to open multiple TDAMemDataTable? For example, I don’t want to using 3 times of “Open” command. Is it possible like “Open[clientdatamodule.sp_userarrright, clientdatamodule.sp_sysright, clientdatamodule.sys_button]”
yes, you can. Use DARemoteAdpater.Fill method. From documentation:
Fill(aTables: array of TDADataTable; aSaveCursor, aIncludeSchema, aAppendMode: Boolean);
Retrieves data from the server for all of the specified TDADataTables. In most scenarios you will not call this method yourself, but simply open the respective data table, causing data to be retrieved automatically. However, calling Fill yourself provides additional flexibility, including the option to fill multiple data tables at the same time, avoiding unnecessary server round-trips."
procedure TClientDataModule.LoadData;
begin
tbl_Orders.Close;
tbl_Users.Close;
// get 2 tables in one request :
RemoteDataAdapter.Fill([tbl_Users,tbl_Orders]);
end;
In my version of DA (7.xxx) for Delphi, when using Fill() the AfterOpen of each table is not fired. Has this changed in later versions? Is there a workaround?