ESRI.ArcGIS.ADF.IMS | |
Query(QueryParameters) Method | |
See Also Example |
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > FeatureLayer Class > Query Method : Query(QueryParameters) Method |
- queryParameters
- Parameters used in the query.
Visual Basic (Declaration) | |
---|---|
Public Overloads Function Query( _ ByVal queryParameters As QueryParameters _ ) As FeatureTable |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public FeatureTable Query( QueryParameters queryParameters ) |
Parameters
- queryParameters
- Parameters used in the query.
Return Value
FeatureTable containing features found.The following example selects all cities with a population over one million that are within 500 kilometers of a specific envelope. It sets up the query filter, which includes both an attribute and a geometry filter (the envelope). It adds a buffer tolerance to the filter, which causes the selection to extend in a buffer around the geometry. It uses the filter in a QueryParameters, which is used to perform the query. If any features are found, they are displayed in a GridView control. The code below assumes an existing MapView object.
For an example of selecting features with a buffer and target layer, see SelectionBuffer.
C# | Copy Code |
---|---|
// Get a reference to the query layer |
Visual Basic | Copy Code |
---|---|
' Get a reference to the query layer |
Use this method to obtain information about features in the map. Layers can be queried by attributes, by geometry, or both.
Dynamic layers can also be queried. Dynamic layers can be added for standard image services. They are not supported for ArcMap Server image services.
This method returns a FeatureTable. Since a
FeatureTable inherits from System.Data.DataTable, it can
be used as the data source for data-bound controls that accept a DataTable,
such as the the
If many features may be returned from the query, you can retrieve a limited number in a single query, then repeat the query to retrieve additional records. This may be a convenient way to display pages of records to users. To use this approach, limit the records returned with QueryParameters.FeatureLimit. Then check the FeatureTable returned for FeatureTable.HasMore. If true, then you can retrieve additional records by using the Query(QueryParameters, int) method, setting the beginRecord parameter to one higher than the number of records already retrieved.
Note that the ArcIMS server may limit the number of features returned from queries. The default is 2000 features, but this can be modified by the server administrator. See the topic "Strategies for using feature limits" in ArcIMS Help for details.
If no features are found, the method returns a DataTable with no rows. Check the DataTable's Rows.Count property to see whether any features are found.
This method may throw an exception if the field(s) in the where expression in the filter do not exist.