ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / QueryFilter Class / PostfixClause Property
Example

In This Topic
    PostfixClause Property (QueryFilter)
    In This Topic
    Gets or sets the postfix clause used by the filter.
    Syntax
    public string PostfixClause {get; set;}
    Public Property PostfixClause As String
    Remarks
    A clause that will be appended to the SELECT statement, following the where clause. Most commonly used for clauses like ORDER BY. e.g., SELECT ArcGIS.Core.Data.QueryFilter.PrefixClauseP:ArcGIS.Core.Data.QueryFilter.PostfixClause.
    Example
    Searching a Table using QueryFilter
    public async Task SearchingATable()
    {
        try
        {
            await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
            {
                using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
                using (Table table = geodatabase.OpenDataset<Table>("EmployeeInfo"))
                {
    
                    QueryFilter queryFilter = new QueryFilter
                    {
                        WhereClause = "COSTCTRN = 'Information Technology'",
                        SubFields = "KNOWNAS, OFFICE, LOCATION",
                        PostfixClause = "ORDER BY OFFICE"
                    };
    
                    using (RowCursor rowCursor = table.Search(queryFilter, false))
                    {
                        while (rowCursor.MoveNext())
                        {
                            using (Row row = rowCursor.Current)
                            {
                                string location = Convert.ToString(row["LOCATION"]);
                                string knownAs = Convert.ToString(row["KNOWNAS"]);
                            }
                        }
                    }
                }
            });
        }
        catch (GeodatabaseFieldException fieldException)
        {
            // One of the fields in the where clause might not exist. There are multiple ways this can be handled:
            // Handle error appropriately
        }
        catch (Exception exception)
        {
            // logger.Error(exception.Message);
        }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also