private void createAndFillPlotsTable() { //DataTable dTblPlots = dSet.Tables.Add("Table", "tblPlots"); //dTblPlots.Columns.Add("PLT_CN",System.Type.GetType("System.String")); IQueryFilter qf = new QueryFilterClass(); qf.SubFields = PlotCnField; if (SubPlotField != "" && SubPlotField != null) { qf.SubFields = PlotCnField + "," + SubPlotField; } IFeatureCursor fCur = SampleFeatureClass.Search(qf, true); int cnIndex = fCur.FindField(PlotCnField); int subIndex = fCur.FindField(SubPlotField); IFeature ftr = fCur.NextFeature(); while (ftr != null) { string plCn = ftr.get_Value(cnIndex).ToString(); string subPlt = "0"; if (subIndex > -1) { object subPltObj = ftr.get_Value(subIndex); if (subPltObj != null) { subPlt = subPltObj.ToString(); } } string pltID = plCn + "_" + subPlt; //Console.WriteLine(pltID); unPlots.Add(pltID); ftr = fCur.NextFeature(); } System.Runtime.InteropServices.Marshal.ReleaseComObject(fCur); }