Sorting within query results

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sorting within query results

elliott17
I am running MGOS 2.2 on IIS.

I am running querymain.aspx and the user can select a column from a drop down list to show in the results window along with OID (SQL Server ID). The results that are shown are sorted by OID. Can the results be sorted by second column that the user selects?
Reply | Threaded
Open this post in threaded view
|

Re: Sorting within query results

Jackie Ng
This gets a bit tricky because you now have to query the capabilities XML of the underlying feature source and you have to look in the capabilities XML for a particular element (I believe it's <SupportsSelectOrdering>true</SupportsSelectOrdering>)

If you find this element, it means the FDO provider for that feature source says ordering is supported, then it is safe to call SetOrderingFilter() in the MgFeatureQueryOptions.

Also ideally from a safety standpoint, your sort ordering field in your UI should be enabled/disabled based on this capability check, to prevent illegal user actions like specifying sort ordering on a Feature Source that does not support ordering.

- Jackie