TTask.Run( procedure var aa: TClientRuleClient; begin aa := TClientRuleClient.Create(SQLConnection1.DBXConnection); ClientDataSet1.Data := aa.GetAll; ClientDataSet1.Open; FreeAndNil(aa); end );