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

来源:互联网 发布:济南淘宝代运营公司 编辑:程序博客网 时间:2024/06/05 05:01
//获取 dataset,后面的方法为自己所写,请根据实情自己填写DataSet dsrows = WMFEntityManager.Instance.GetEntityInfoByPKLite2("admin", "im_group", "is_del", "1", "owner", "" + order_id + "", "");//创建ListList<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());      }}
0 0
原创粉丝点击