dataset中获取其中一个表中某列的值放到List中

//获取 dataset,后面的方法为自己所写,请根据实情自己填写
DataSet dsrows = WMFEntityManager.Instance.GetEntityInfoByPKLite2("admin", "im_group", "is_del", "1", "owner", "" + order_id + "", "");
//创建List
List<string > grie=new List<string>();
if (dsrows != null)
{
   for (int i = 0; i < dsrows.Tables[0].Rows.Count; i++)
      {
      //将表中字段为“group_id”的列数据存储到List中
         grie.Add(dsrows.Tables[0].Rows[i]["group_id"].ToString());
      }
}

猜你喜欢

转载自blog.csdn.net/qwasdf_123/article/details/48155991