动态取值

 DataSet dsResult = IBLL.Factory.wfProjectStep_TableInfoCreate().GetTableInfo(strWhere);
//获得动态的列值

public string GetTableCloInfo(DataSet ds, string Col) //dsResult里面-------【Col】 列的名称
        {
            string Result = "";
            if (ds == null)
            {
                //Result = "数据为空";
                return Result;
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                try
                {
                    Result = ds.Tables[0].Rows[0][Col] + "";
                }
                catch
                {
                    Result = "";
                }
            }
            return Result;
        }

 

posted @ 2018-12-11 18:00  没有狐狸的南墙  阅读(179)  评论(0编辑  收藏  举报