首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

怎么在一个combobox下拉条中用sql语句显示数据库中用户名的所有内容

2012-04-12 
如何在一个combobox下拉条中用sql语句显示数据库中用户名的所有内容如何在一个combobox下拉条中用sql语句

如何在一个combobox下拉条中用sql语句显示数据库中用户名的所有内容
如何在一个combobox下拉条中用sql语句显示数据库中用户名的所有内容

[解决办法]
with adoquery do
begin
 close;
 sql.text:='select 用戶 from 用戶表';
 open;
 combobox.clear;
 while not eof do
 begin
combobox.items.add(fields[0].asstring);
next;
 end;
end;
[解决办法]

Delphi(Pascal) code
if ComboBox1.Items.Count >0 then  ComboBox1.ItemIndex := 0;或者ComboBox1.Text := 'xxx'; 

热点排行