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 tpath.combine(); {结合路径}

Delphi版多开源码,也就是遍历系统内核对象句柄

Delphi的四舍五入函数

Delphi datasnap 上传/下载大文件(本demo以图传片文件为例)

Delphi xe5 android得到手机的手机号码

Delphi遍历所有控件

Delphi 把整个窗体保存为图片的方法

Delphi 中文字符串截取

Delphi excel数据导入数据库表

Delphi application.processmessages

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



打赏

取消

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

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

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

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

评论

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