I try to use IFeatureCursor and Search in order to select from my feature class some values. I need to select multiple rows, which will be later saved in my array and exported to pdf. I have problem with this line:
IFeatureCursor pedCursor2 = selectionASet.Search(null, true);
Error 1 No overload for method 'Search' takes 2 arguments
Does anyone has idea how to fix it? Thanks a lot!
Here is a bigger chunk of the code to add some context
public void pedAISelectionSet(IFeatureClass featureClassPed)
{
IDataset dataset = (IDataset)featureClassPed;
//Set up query filter and use it to create the selection set
IQueryFilter queryAPedFilter = new QueryFilterClass();
string distanceAWhereClause = "\"S_" + optCode + "\" = " + "'A'";
queryAPedFilter.WhereClause = distanceAWhereClause;
//use the query filter to select features
ISelectionSet selectionASet = featureClassPed.Select(queryAPedFilter, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionNormal, dataset.Workspace);
int pedASelectionCount = selectionASet.Count;
//getting the values for each field and saving it into variables
IFields pedAFields = featureClassPed.Fields;
int distanceAField = pedAFields.FindField("S_00000");
int streetAField = pedAFields.FindField("Street");
int fromALeftField = pedAFields.FindField("FromLeft");
int toALeftField = pedAFields.FindField("ToLeft");
int fromARightField = pedAFields.FindField("FromRight");
int toARightField = pedAFields.FindField("ToRight");
//cursor
IFeatureCursor pedCursor = featureClassPed.Update(queryAPedFilter, false);
IFeature pedFeature = pedCursor.NextFeature();
//saving variables
string streetAValue = pedFeature.get_Value(streetAField).ToString();
string fromALeftValue = pedFeature.get_Value(fromALeftField).ToString();
string toALeftValue = pedFeature.get_Value(toALeftField).ToString();
string fromARightValue = pedFeature.get_Value(fromARightField).ToString();
string toARightValue = pedFeature.get_Value(toARightField).ToString();
//building an array
IFeatureCursor pedCursor2 = selectionASet.Search(null, true);
IFeature pedFeature2 = pedCursor2.NextFeature();
pedArrayA = new List<String[]>();
string streetValue, fromLeftValue, toLeftValue, fromRightValue, toRightValue;
while (pedFeature != null)
{
streetAValue = pedFeature2.get_Value(streetAField).ToString();
fromALeftValue = pedFeature2.get_Value(fromALeftField).ToString();
toALeftValue = pedFeature2.get_Value(toALeftField).ToString();
fromARightValue = pedFeature2.get_Value(fromARightField).ToString();
toARightValue = pedFeature2.get_Value(toARightField).ToString();
string[] local = new string[5] { streetAValue, fromALeftValue, toALeftValue, fromARightValue, toARightValue };
pedArrayA.Add(local);
pedFeature2 = pedCursor2.NextFeature();
}
}