Fill a Stringlist with Dataset

Hi

until now ( with Fibplus / Delphi ) i used a query to fill a Stringlist

procedure TDM_hotel.camps_select(Sender: TObject);
begin
frm_hotel.C_NO_select.Items.Clear;
DM.Q_Camps.ExecQuery;
while not DM.Q_Camps.Eof do
begin
camp_ident := DM.Q_Camps.FieldByName(‘COUNTRY’).AsString + ‘'+ DM.Q_Camps.FieldByName(‘C_NO’).AsString + '’ + DM.Q_Camps.FieldByName(‘CITY’).AsString ;
frm_hotel.C_NO_select.Items.Add (camp_ident);
DM.Q_Camps.Next;
end;
end;

How i do this with RO?
Any suggestions on thisTopic?
Thanks Manfred

with RO, your code will be the same.
with DA: on what side (client or server) you want to fill string list?

Hi EvgenyK
Sorry for the late replay.

with DA: on what side (client or server) you want to fill string list?
This would be on the client side.

I’m assuming you have custom DAD server and client that were created with our wizard.

If you don’t have this table in server-side schema, you need to declare it in TDASchema component inside _impl.
dbl-click on TDASchema, Schema Modeler will be launched.
pls read more about how to create table manually with Schema Modeler.
rebuild server and start it.

on client-side, create a new table from popup menu of RDA.
finally your code will be looks like at:

procedure TDM_hotel.camps_select(Sender: TObject);
begin
  frm_hotel.C_NO_select.Items.Clear;
  DM.tbl_Camps.Open; //tbl_Camps - table that is created by RDA 
  while not DM.tbl_Camps.Eof do begin
     camp_ident := 
           DM.tbl_Camps.FieldByName('COUNTRY').AsString + ''+ 
           DM.tbl_Camps.FieldByName('C_NO').AsString + '' + 
           DM.tbl_Camps.FieldByName('CITY').AsString ;
     frm_hotel.C_NO_select.Items.Add (camp_ident);
     DM.tbl_Camps.Next;
  end;
end;

Hi
I have the Relativity Server since the Server will run finally under Linux.

Great thank you, it works just fine. :wink:
Shalom
Manfred

With Relativity server, you can use DA SQL technology:

  lRemoteDataAdapter.FillWithDASql(ltable,'select ...');
  while not ltable.Eof do begin
     camp_ident := 
           ltable.FieldByName('COUNTRY').AsString + ''+ 
           ltable.FieldByName('C_NO').AsString + '' + 
           ltable.FieldByName('CITY').AsString ;
     frm_hotel.C_NO_select.Items.Add (camp_ident);
     ltable.Next;
  end;

See standard DASQL example for more details