//针对这些数据进行去重,取某一列就用这一列字段,把重复的去掉 DataSet ds = dao.get(); DataTable dt = ds.Table[0] DataView dv = dt.DefaultView; DataTable dt1 = dv.ToTable(true, "IADDDTIME"); for (int g = 0; g < dt1.Rows.Count; g++) { DateTime ITAADDDTIME = Convert.ToDateTime(dt1.Rows[g]["IADDDTIME"].ToString()); if (g == dt1.Rows.Count - 1) date += ITAADDDTIME.Year + "年" + ITAADDDTIME.Month + "月" + ITAADDDTIME.Day + "日"; else date += ITAADDDTIME.Year + "年" + ITAADDDTIME.Month + "月" + ITAADDDTIME.Day + "日" + "、"; }
时间: 2024-10-16 19:00:48