Hi,
Here is the code to eliminate duplicate rows, but what if I want to keep
them and elimiante all other the unique ?
public void RemoveDuplicateRows(DataTable dTable,string colName)
{
Hashtable hTable = new Hashtable();
ArrayList duplicateList = new ArrayList();
foreach(DataRow drow in dTable.Rows)
{
try
{
hTable.Add(drow[colName],string.Empty);
}
catch
{
duplicateList.Add(drow);
}
}
foreach(DataRow dRow in duplicateList)
dTable.Rows.Remove(dRow);
}
Thanks