Z
Zeng
Would someone know why SortedList doesn't work for these two keys?
[ArgumentException: Item has already been added. Key in dictionary:
"xyzbf8d7a21-d4c2-46a7-b005-a15d6ea3a20f" Key being added:
"xyz9097aa36-a64b-406b-8b27-33b42f4890b6"]
System.Collections.SortedList.Add(Object key, Object value) +221
My code looks something like below, the Guid.NewGuid().ToString() is
appended to make sure the key is unique in case of duplicated data.
foreach( CRecord rec in m_sortedList.Values )
{
tmplist.Add( rec.DataRow[fieldName].ToString() +
Guid.NewGuid().ToString(), rec );
}
[ArgumentException: Item has already been added. Key in dictionary:
"xyzbf8d7a21-d4c2-46a7-b005-a15d6ea3a20f" Key being added:
"xyz9097aa36-a64b-406b-8b27-33b42f4890b6"]
System.Collections.SortedList.Add(Object key, Object value) +221
My code looks something like below, the Guid.NewGuid().ToString() is
appended to make sure the key is unique in case of duplicated data.
foreach( CRecord rec in m_sortedList.Values )
{
tmplist.Add( rec.DataRow[fieldName].ToString() +
Guid.NewGuid().ToString(), rec );
}