Combobox.Items.Strings[Combobox.ItemIndex]

解决方案 »

  1.   

    非常简单,你把items中的文本放到数据集的查询语句中就行了,例如:
    Query1->Active := False;
    Query1->SQL->Clear;
    Query1->SQL->Add('select * from demotable where col like ":Param"');
    Query1->SQL->ParamsByName('Param').AsString := Combobox.Items.Strings[Combobox.ItemIndex] 
    Query1->Active := True;
    数据集返回的就是你需要的结果
      

  2.   

    查询出来的结果为什么不能直接编辑,总是dbgrid无响应,tell me
      

  3.   

    oooooooooooooookkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
    ----------but,我又无法操作查询纪录,即insert……,
    只能在grid里写入something
      

  4.   

    不行了,连纪录都返回不了
    我这个:部门名称=:Combobox.Items.Strings[Combobox.ItemIndex]  
    写法对吗?我定param的属性为string
      

  5.   

    Combobox.Items[Combobox.ItemIndex] 因为itemindex是按照combobox里的每个条目,进行查询的!