i am trying to enumerate through the primary keys in a table.
i create an enumeration like so:
System.Collections.IEnumerator e =ds.Tables[table.ToString()].PrimaryKey.GetEnumerator();
i then try to cycle through the items like so:
now i know that there is one entry in the table, but as soon as i call the moveNext method, get an error telling me the ennumeration has already finished. what am i doing wrong?
i create an enumeration like so:
System.Collections.IEnumerator e =ds.Tables[table.ToString()].PrimaryKey.GetEnumerator();
i then try to cycle through the items like so:
Code:
while((e.MoveNext())&&( e.Current != null))
{
if(e.Current.ToString() == key)
{
exists = true;
break;
}
}