DataSet添加新列
DataSet ds = jhPhotoAlbum.GetList("JH5='" + key + "'"); ds.Tables[0].Columns.Add("count", typeof(System.String)); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["count"] = "11"; }
Dataset 获取前10行
DataSet ds = jhJiFenRecord.GetList("JH1='" + openid + "' and JH6='" + key + "' order by AddTime desc"); DataTable mydt = ds.Tables[0]; if (mydt.Rows.Count > 10) { DataTable dt = new DataTable(); dt = ds.Tables[0].Clone(); for (int i = 0; i < 10; i++) { dt.Rows.Add(mydt.Rows[i].ItemArray); } mydt = dt; }