获取的数据载入listview控件中
2013-06-02 19:47 李龙江 阅读(329) 评论(0) 编辑 收藏 举报ListView1.Items.Clear; ADOQuery1.close; ADOQuery1.sql.clear; ADOQuery1.sql.add('select * from Employees'); ADOQuery1.Open; while not ADOQuery1.eof do begin with ListView1.items.add do begin caption:=ADOQuery1.FieldByName('EmployeeID').AsString; subitems.add(ADOQuery1.FieldByName('FirstName').AsString); subitems.add(ADOQuery1.FieldByName('lastname').AsString); subitems.add(ADOQuery1.FieldByName('Title').AsString); end; ADOQuery1.Next; end;
效果: