Select to view content in your preferred language

Select features from a Feature Class

2468
3
Jump to solution
10-11-2013 07:27 AM
ShaningYu
Honored Contributor
For Feature Class in a GDB, I queried in Oracle SQL Developer:
select * from RailLRSRoutes where RouteName = 'A1'
and got 12 records returned.  Got the same results using Definition Query in ArcMap.
In the piece of code below:
            IQueryFilter queryFilter = new QueryFilterClass();
            queryFilter.WhereClause = "RouteName = 'A1' ";
            IDataset dataset = (IDataset)fc;
            ISelectionSet pSelectionSet = fc.Select(queryFilter, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionOnlyOne, dataset.Workspace);
the pSelectionSet.Count = 1 rather than multiple.  What's wrong with my code here?  Thanks.
0 Kudos
1 Solution

Accepted Solutions
JeffMatson
Frequent Contributor
Try changing esriSelectionOption.esriSelectionOptionOnlyOne to esriSelectionOption.esriSelectionOptionNormal



For Feature Class in a GDB, I queried in Oracle SQL Developer:
select * from RailLRSRoutes where RouteName = 'A1'
and got 12 records returned.  Got the same results using Definition Query in ArcMap.
In the piece of code below:
            IQueryFilter queryFilter = new QueryFilterClass();
            queryFilter.WhereClause = "RouteName = 'A1' ";
            IDataset dataset = (IDataset)fc;
            ISelectionSet pSelectionSet = fc.Select(queryFilter, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionOnlyOne, dataset.Workspace);
the pSelectionSet.Count = 1 rather than multiple.  What's wrong with my code here?  Thanks.

View solution in original post

0 Kudos
3 Replies
JeffMatson
Frequent Contributor
Try changing esriSelectionOption.esriSelectionOptionOnlyOne to esriSelectionOption.esriSelectionOptionNormal



For Feature Class in a GDB, I queried in Oracle SQL Developer:
select * from RailLRSRoutes where RouteName = 'A1'
and got 12 records returned.  Got the same results using Definition Query in ArcMap.
In the piece of code below:
            IQueryFilter queryFilter = new QueryFilterClass();
            queryFilter.WhereClause = "RouteName = 'A1' ";
            IDataset dataset = (IDataset)fc;
            ISelectionSet pSelectionSet = fc.Select(queryFilter, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionOnlyOne, dataset.Workspace);
the pSelectionSet.Count = 1 rather than multiple.  What's wrong with my code here?  Thanks.
0 Kudos
ShaningYu
Honored Contributor
jeffmatson:  Wonderful.  Problem fixed per your feedback.  Thanks and have a nice weekend!
0 Kudos
LeoDonahue
Deactivated User
Way to go Jeff Matson!!

Eustace would sell those points for money to pay his taxes.
0 Kudos