[mapguide-users] RE: How to use count or max expression in fdo
providerfor sdf
Bruno Scott
bscott at geomapgis.com
Tue Oct 2 04:10:25 EDT 2007
Thanks Jason
it works with SelectAggregates
Updated code:
MgFeatureAggregateOptions queryOptions = new
MgFeatureAggregateOptions();
//count(*) does not work : String does not represent a valid expression
//queryOptions.AddComputedProperty("Count", "Count(*)");
//count() : One or more arguments for function 'Count' did not match the
expected argument types
//queryOptions.AddComputedProperty("Count", "Count()");
// this one works
//queryOptions.AddComputedProperty("Count",
"Count(Autogenerated_SDF_ID)");
// this one works also
queryOptions.AddComputedProperty("Count", "Count(1)");
MgDataReader dataReader = featureService.SelectAggregate(resId,
featureClass, queryOptions);
What was misleading me is when i ask the provider for
GetCommandCapabilities();
it does not return FdoCommandType_SelectAggregates
Should the sdf provider GetCommandCapabilities return
FdoCommandType_SelectAggregates?
Bruno
JasonBirch wrote:
>
> Bruno,
>
> Where is it failing? At the SelectFeatures call? I'm wondering if you
> might need SelectAggregate instead.
>
> Jason
>
> -----Original Message-----
> From: Bruno Scott
> Subject: [mapguide-users] How to use count or max expression in fdo
> providerfor sdf
>
> //this one returns : Invalid property name: Count()
> //queryOptions.AddFeatureProperty("Count()");
>
> //this one returns : The function 'Count' is not supported by this
> provider
> queryOptions.AddComputedProperty("Count", "Count()");
>
> MgFeatureReader dataReader = featureService.SelectFeatures(resId,
> "SHP_Schema:Parcels", queryOptions);
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
--
View this message in context: http://www.nabble.com/How-to-use-count-or-max-expression-in-fdo-provider-for-sdf-tf4548772s16610.html#a12994621
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list