Home > Back-end >  How is the DBLookupComboboxEh1. KeyValue converted to type int?
How is the DBLookupComboboxEh1. KeyValue converted to type int?

Time:09-16

DBLookupComboboxEh1 KeyValue associated field is numeric (18, 0), how to DBLookupComboboxEh1. The KeyValue values into an int type? Because in the query, where B.d ept='+ cbdept. KeyValue +' '; Always quote character conversion error, dept of the int type

CodePudding user response:

[size=16 px] Delphi a TStringHelper class, and can convert character type
Var
S: a string;
I: integer;
The begin
S:='1';
I:=s.T oInteger;//I=1
If not TryStrToInt (s, I) then
ShowMessage (' conversion error)
The else
ShowMessage (' transformation success: + I.T oString);

end;

[/size]

CodePudding user response:

Var
I: integer;
The begin
I:=DBLookupComboboxEh1. KeyValue;
end;

CodePudding user response:

intToStr
  • Related