在dbcombobox中可不可以
显示值 提交值
男 1
女 0在选择时显示的是显示值,可是提交post时,提交的是int型的0或1;
其中dbcombobox只联接一个数据源!不用在listdatastore中联接其它数据源来对应提交值!(注:只联接一个数据源!)
显示值 提交值
男 1
女 0在选择时显示的是显示值,可是提交post时,提交的是int型的0或1;
其中dbcombobox只联接一个数据源!不用在listdatastore中联接其它数据源来对应提交值!(注:只联接一个数据源!)
DisplayText: Boolean);
begin
case Sender.AsInteger of
0: Text := '女';
1: Text := '男';
end;
end;procedure TForm1.ADOQuery1SexSetText(Sender: TField; const Text: string);
begin
if Text = '女' then
Sender.Value := 0
else if Text = '男' then
Sender.Value := 1;
end;