cs_tgr74
Messages postés23Date d'inscriptionjeudi 22 mars 2007StatutMembreDernière intervention26 août 2009
-
12 sept. 2008 à 11:49
f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 2022
-
12 sept. 2008 à 11:56
Bonjour à tous,
j'ai besoin de votre aide pour charger les données d'une requête de sélection dans un stringgrid.
j'ai déjà essayer le code suivant mais le résultat n'est pas bon. merci de votre prompte réaction.
var i,j : integer;
begin
softbankdata.SelectionBillet;
softbankdata.qryBillet.Last;
c:=softbankdata.qryBillet.RecordCount;
softbankdata.qryBillet.First;
while not softbankdata.qryBillet.Eof do
begin
With StringGrid1 do
begin
RowCount := c;
ColCount :=3;
f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 202235 12 sept. 2008 à 11:56
logiquement tu devrait avoir ceci :
var J,C : integer;
begin
softbankdata.SelectionBillet;
softbankdata.qryBillet.Last;
C := softbankdata.qryBillet.RecordCount;
softbankdata.qryBillet.First;
J := 1;
while (not softbankdata.qryBillet.Eof) or (J <= C) do
begin
StringGrid1.Cells[0,J] := format('%n',[softbankdata.qryBilletVALEUR.Value]);
StringGrid1.Cells[1,J] := softbankdata.qryBilletLIBELLE.Value;
StringGrid1.Cells[2,J] := format('%n',[softbankdata.qryBilletNOMBRE.Value]);
softbankdata.qryBillet.Next;
inc(J);
end;
end;