S sharkboy Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-07 #1 如何把数据表中三个字段分别分给stringgrid的三列,然后再合计字段中能自动显示数值? 品名 单价 数量 合计 苹果 3 2 6 梨子 1 3 3
L lotostree Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-07 #2 select 品名,数量,(品名*数量) as 合计 from 数据表
H HunterTeam Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-07 #3 With Adodataset1 do begin Close; CommandText:='select 品名,数量,(品名*数量) as 合计 from 数据表'; Open; While not eof do begin for i:=0 to fieldCount-1 do StringGrid1.Cells[i+1,RecNo]:=fields.Asstring; next; end; end;
With Adodataset1 do begin Close; CommandText:='select 品名,数量,(品名*数量) as 合计 from 数据表'; Open; While not eof do begin for i:=0 to fieldCount-1 do StringGrid1.Cells[i+1,RecNo]:=fields.Asstring; next; end; end;