private void CheckDataRepeat(DataSet dataSet, out string message)
{
message = string.Empty;
DataView dv = new DataView(dataSet.Tables[0]);
DataTable dtBmzd = null;
dtBmzd = dv.ToTable(true, new string[] { "列名1", "列名2" });
if (dtBmzd.Rows.Count < dataSet.Tables[0].Rows.Count)
{
message += "【列名1】、【列名2】值必须唯一,Excel中存在重复的数据,请确认!\n";
}
}
版权属于:
Laughing
本文链接:
https://lisen.cc/back/datatable-is-efficient-in-determining-whether-there-is-repeated-data.html
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
顶替夺标地顶替顶替
啊哈哈,正好需要