delphi-dbgrid取得所有表中的值


本文整理自网络,侵删。

 

把当前dbgrid的值的第一个值(id)全部写到了一个tstringlist了

 

var tlist:TStringlist;

s_tmp:string;
icount,i:integer;
begin
tlist:=TStringlist.Create;
icount:=TStringGrid(DBGrid1).RowCount-1;
with dbgrid1.datasource.dataset do
begin
for i := 0 to icount -1 do
begin
recno:=i+1;
s_tmp:=DBGrid1.Fields[0].DisplayText;
tlist.Add(s_tmp);
end;
end;
result.Text:=tlist.Text;
tlist.Free;

 

 

 

 

相关阅读 >>

Delphi截取字符串

Delphi webbrowser1 缩放网页

Delphi 泛型搜索字符串数组

Delphi udp文件传输

Delphi 压缩与修复access数据库

Delphi 通过api强制tedit仅接受数字输入

Delphi memo 循环往上往下滚动

Delphi 调用外部程序获取程序id,并能关闭该程序

Delphi tms web core twebsocketclient

Delphi 进程防杀之hook api法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...