What about Frequency Tool,It will get the count.You can get the result in InMemory Table and populate it to your list.You can run the tool from Arcmap and check its performance and output structue.Sample: private ITable RunFrequencyTool(ITable inputTable, string inputField)
{
try
{
ESRI.ArcGIS.AnalysisTools.Frequency FrequencyTool = new ESRI.ArcGIS.AnalysisTools.Frequency();
ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult Result;
FrequencyTool.in_table = inputTable;
FrequencyTool.frequency_fields = inputField;
FrequencyTool.out_table = "in_memory\\Result";
Result = RunTool(FrequencyTool, null);
return GetTablefromResult(Result);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return null;
}
}
private ESRI.ArcGIS.Geodatabase.ITable GetTablefromResult(ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult result)
{
ESRI.ArcGIS.Geodatabase.IGPValue GPVal;
string OutputTableName;
ESRI.ArcGIS.Geoprocessing.IGPUtilities3 GPUtil = new ESRI.ArcGIS.Geoprocessing.GPUtilities() as ESRI.ArcGIS.Geoprocessing.IGPUtilities3;
ESRI.ArcGIS.Geodatabase.ITable pOutputTable;
try
{
GPVal = result.GetOutput(0);
OutputTableName = GPVal.GetAsText();
pOutputTable = GPUtil.OpenTableFromString(OutputTableName);
return pOutputTable;
}
catch (Exception ex)
{
return null;
}
}