protected DataTable RemoveRepeatRows(DataTable sourcedt)
{
DataTable dtResult = sourcedt.Clone();
List<int> contentIDList = new List<int>();
List<int> threadIDList = new List<int>();
if (sourcedt != null)
{
foreach (DataRow item in sourcedt.Rows)
{
int contentID = Convert.ToInt32(item["ContentID"]);
int threadID = Convert.ToInt32(item["ArticleID"]);
if (!contentIDList.Contains(contentID))
{
if (!threadIDList.Contains(threadID))
{
dtResult.ImportRow(item);
contentIDList.Add(contentID);
threadIDList.Add(threadID);
}
}
}
}
return dtResult;
}