public DataTable GetMenByMan(int manid)
{
DataTable man = new DataTable();
.....
return man;
}

解决方案 »

  1.   

    如果需要保留原来的数据。
    还有一个办法就是,
    定义的时候
    DataTable man=new DataTable();
    改为
    Dataable man = null;函数改写为:
    public DataTable GetMenByMan(int manid)
    {
    if (man == null)
             {
    man = new DataTable();
    man.Columns.Add("menid");
    man.Columns.Add("manname");
    }
    DataSet ds=new DataSet();
    string sqlGetplace="select HR_DutyID from Hr_Duty where UserID='"+manid+"'";
    ds=db.GetDataSet(sqlGetplace,"placeparent");
    int[] p={Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString())};
    GetChildPlaceMan(p);
    return man;
    }