P
paragdere
Hi all,
I have written a code, to generate a tree structure. The root node can
have "n" nodes attached to it, while each of these "n" nodes will have
6 child nodes.
The function is named generateNodes() and the value of "n" is passed to
it.
private void generatenodes(ParentNode pn, int counter)
{
for(int i = 0; i<counter;i++)
{
ParentNode node = new ParentNode();
node.Controls.Add(new LiteralControl("test1"));
for(int j=0;j<6;j++)
{
ParentNode dn1 = new ParentNode();
dn1.Controls.Add(new LiteralControl("test2"));
node.Nodes.Add(dn1);
}
dn.Nodes.Add(node);
}
}
This function works fine till the value of the counter is less than 90.
Once it reaches 90 it starts giving a Stack overflow error.
Please note that :
1) Error occurs on windows 2003 server, not on 2000 server. In 2000, it
works all fine
2) Error occurs on .NET ver 1.1 not on 2.0. On migrating the code to
2.0, the code worked fine on a 2003 server as well..
Changing the environment to 2000 is not a solution, nor can we migrate
the code to 2.0 without completely retesting the application.
Can anyone suggest a way to overcome the problem?
Thanking you in advance.
Awaiting some inputs..
I have written a code, to generate a tree structure. The root node can
have "n" nodes attached to it, while each of these "n" nodes will have
6 child nodes.
The function is named generateNodes() and the value of "n" is passed to
it.
private void generatenodes(ParentNode pn, int counter)
{
for(int i = 0; i<counter;i++)
{
ParentNode node = new ParentNode();
node.Controls.Add(new LiteralControl("test1"));
for(int j=0;j<6;j++)
{
ParentNode dn1 = new ParentNode();
dn1.Controls.Add(new LiteralControl("test2"));
node.Nodes.Add(dn1);
}
dn.Nodes.Add(node);
}
}
This function works fine till the value of the counter is less than 90.
Once it reaches 90 it starts giving a Stack overflow error.
Please note that :
1) Error occurs on windows 2003 server, not on 2000 server. In 2000, it
works all fine
2) Error occurs on .NET ver 1.1 not on 2.0. On migrating the code to
2.0, the code worked fine on a 2003 server as well..
Changing the environment to 2000 is not a solution, nor can we migrate
the code to 2.0 without completely retesting the application.
Can anyone suggest a way to overcome the problem?
Thanking you in advance.
Awaiting some inputs..