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内嵌汇编实现�载任意进程的某个dll

Delphi 10 下提示sharedactivitycontext错误的解决方法

Delphi 链接获取主站地址

dll 的静态调用实例代码

Delphi读写utf-8、unicode格式文本文件

Delphi spcomm 调试串口解决总是在程序断开的时候才发送指令的问题

Delphi 10.3.x与android 10兼容性的问题

Delphi 读写附加数据

Delphi 查找某目录下的特定文件

Delphi unigui 获取files路径

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



打赏

取消

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

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

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

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

评论

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