#region datatable去重 ////// datatable去重 /// /// 需要去重的datatable /// 依据哪些列去重 ///public static DataTable GetDistinctTable(DataTable dtSource, params string[] columnNames) { DataTable distinctTable = dtSource.Clone(); try { if (dtSource != null && dtSource.Rows.Count > 0) { DataView dv = new DataView(dtSource); distinctTable = dv.ToTable(true, columnNames); } } catch (Exception ee) { MessageBox.Show(ee.ToString()); } return distinctTable; } /// /// datatable去重 /// /// 需要去重的datatable ///public static DataTable GetDistinctTable(DataTable dtSource) { DataTable distinctTable = null; try { if (dtSource != null && dtSource.Rows.Count > 0) { string[] columnNames = GetTableColumnName(dtSource); DataView dv = new DataView(dtSource); distinctTable = dv.ToTable(true, columnNames); } } catch (Exception ee) { MessageBox.Show(ee.ToString()); } return distinctTable; } #endregion #region 获取表中所有列名 public static string[] GetTableColumnName(DataTable dt) { string cols = string.Empty; for (int i = 0; i < dt.Columns.Count; i++) { cols += (dt.Columns[i].ColumnName + ","); } cols = cols.TrimEnd(','); return cols.Split(','); } #endregion
以上就是c# datatable中重复数据去重的内容,更多相关内容请关注php中文网(www.php.cn)!
预订版是外卖通系列软件之一,此版本和专业外卖版不一样,专业预订版侧重于餐饮业在线预订的实现。平台为用户提供大量的餐饮数据,由于人们对吃的要求苛刻与不通,用户不用在为去哪里吃饭而发愁,用户可以通过平台筛选就餐目标,然后执行预订操作;平台作为就餐者和商家的介质,从平台预订的可以享受一定的折扣,消费者同样可以从预订结果中获得一定的积分收入;同样,和外卖版一样,集成了短信通知、广告管理、专题管理、推广、多









