I solved the problem using LINQ:
//Get Values from Column "KSTNR"
var kstnr = (from i in cpxx_helpDataSet.help_U_KSTKOSTEN
orderby i.KSTNR
select i.KSTNR).ToList();
//Fill list with duplicates
var query = kstnr.GroupBy(x => x).Where(g => g.Count() > 1).Select(y => y.Key).ToList();
//If List not empty then show messagebox
if(query.Any())
{
MessageBox.Show("Duplicates found");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.