D
dennyshao001
Unregistered / Unconfirmed
GUEST, unregistred user!
if cdsTree.RecordCount>0 then
begin
cdsTree.First;
while not cdsTree.Eof do
begin
try
Inc(nodeCount);
treeview1.Items.AddChild(rootNode,cdsTree.FieldValues['manager']);
treeview1.Items[nodeCount].ImageIndex:=1;
treeview1.Items[nodeCount].SelectedIndex:=1;
parentnode:=treeview1.Items[nodecount];
treeview1.Items[nodeCount].Expanded:=True;
{ TODO : 添加二级设备 }
createParentTree(treeview1,cdsTree.FieldValues['manager']);
cdsTree.Next;
except
Break;
end;
end;
我调试出来cdsTree.RecordCount:=2,为什么while下得循环只执行一次,在delphi6中用同样得代码就正确得,我快要崩溃了.;而且RecordCount还不能直接用TSQLQuery,我用了TSQLQuery+TDataSetProvider+TClientDataSet才能取到RecordCount,郁闷中..
begin
cdsTree.First;
while not cdsTree.Eof do
begin
try
Inc(nodeCount);
treeview1.Items.AddChild(rootNode,cdsTree.FieldValues['manager']);
treeview1.Items[nodeCount].ImageIndex:=1;
treeview1.Items[nodeCount].SelectedIndex:=1;
parentnode:=treeview1.Items[nodecount];
treeview1.Items[nodeCount].Expanded:=True;
{ TODO : 添加二级设备 }
createParentTree(treeview1,cdsTree.FieldValues['manager']);
cdsTree.Next;
except
Break;
end;
end;
我调试出来cdsTree.RecordCount:=2,为什么while下得循环只执行一次,在delphi6中用同样得代码就正确得,我快要崩溃了.;而且RecordCount还不能直接用TSQLQuery,我用了TSQLQuery+TDataSetProvider+TClientDataSet才能取到RecordCount,郁闷中..