动态取值

 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;
        }

猜你喜欢

转载自www.cnblogs.com/shanshuiYiCheng/p/10103840.html
今日推荐