protected void ibt_update_type_Click(object sender, EventArgs e)
    {
        DataTable dt = bs.GetDictionary(" ").Table;
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string pid = dt.Rows[i]["tp_id"].ToString();
            string classid = pid + ",";
            classid = GetBindNode(classid, pid);
            classid = classid.Substring(0, classid.Length - 1);
            bool isbo = be.update_class(classid, pid);
        }
    }
    //绑定子分类
    string GetBindNode(string classid, string parentid)
    {
        DataTable smdt = bs.GetDictionary(" and tp_ParentId= " + parentid).Table;
        int it = smdt.Rows.Count;
        if (it == 0)
        {
            return classid;
        }
        else
        {
            for (int i = 0; i < smdt.Rows.Count; i++)
            {
                string csid = smdt.Rows[i]["tp_id"].ToString();
                classid += smdt.Rows[i]["tp_id"].ToString() + ",";
                GetBindNode(classid, csid); 
            }
        }
        return classid;
    }
为什么我让it等于O的时候退出这个方法 ,但是为什么他不退出继续执行for循环里面的GetBindNode方法,这样导致classid里面只能追加两个,其它的都追加不上。谢谢各位。。我头疼一天了帮帮忙