From:http://www.cnblogs.com/3echo/archive/2006/08/16/478094.html
1 / /<summary>
2 ///get unique values for a field of a feature class
3 /// </summary>
4 /// <param name= "Pfeatureclass" >Feature Class</param>
5 /// <param name= "STRFLD" >Specify a field to get a unique value</param>
6 /// <returns>unique value character data</returns>
7list<string> Getuniquevalue (Ifeatureclass pfeatureclass,stringSTRFLD)
8{
9list<string> LST =Newlist<string> ();
Ten//Get ifeaturecursor Cursors
OneIfeaturecursor pcursor = Pfeatureclass.search (NULL,false);
A
-//CoClass Object instance generation
-Idatastatistics PData =NewDatastatisticsclass ();
thePdata.field = STRFLD;
-Pdata.cursor = Pcursor asICursor;
-
-//Enumerate unique values
+IEnumerator Penumvar = pdata.uniquevalues;
-
+//Total Records
AintRecordCount = Pdata.uniquevaluecount;
at
-//character Array
-Penumvar.reset ();
-
- while(Penumvar.movenext ())
-{
inLst. ADD (PEnumVar.Current.ToString ());
-}
to
+returnLst
-}
ArcGis gets the unique value of a field in a datasheet