Home > Back-end >  DELPHI adoquery binding the processing data set records.
DELPHI adoquery binding the processing data set records.

Time:10-12

DELPHI adoquery binding data sets adodataset A and B have two fields, A value of 1 records, how to select field and record the corresponding field B value addition,

CodePudding user response:

Adodataset. Filter:='a=1;
Adodataset. Filtered:=true;
//

CodePudding user response:

reference 1st floor case5166 response:
adodataset. Filter:='a=1;
Adodataset. Filtered:=true;
//
because I data sets binding in the grid, there will be data changes, so I want to manipulate
the data set
 
Var totalM, totalE: integer;
The begin
For I:=1 to the dataset. RecordCount do
The begin
If the dataset. Fields [0]. Value=https://bbs.csdn.net/topics/1 then
TotalM:=totalM + dataset Fields [1]. The AsInteger
Else if the dataset. Fields [0]. Value=https://bbs.csdn.net/topics/2 then
TotalE:=totalE + dataset Fields [1]. The AsInteger;
end;
end;

It is there a problem?
  • Related