Hi,
When I try to build my code it gives an error "Not all code paths return a value".
Please find the code below:
public TreeNode FindInstanceNode(string SubContainer,string instance)
{
TreeNode Node = GetTreeViewClickedNode();
foreach (TreeNode trNode in Node.Nodes)
{
if (trNode.Text == "SUB-CONTAINERS")
{
TreeNodeCollection tcSubNodes = trNode.Nodes;
foreach (TreeNode trInode in tcSubNodes)
{
TreeNodeCollection tcInsNodes = trInode.Nodes;
foreach (TreeNode InstanceNode in tcInsNodes)
{
if (InstanceNode.Text == "INSTANCE" && InstanceNode.FirstNode.Name == instance)
{
return InstanceNode;
}
}
}
}
}
}