[mapguide-users] MgDateTimeException

Jackie Ng jumpinjackie at gmail.com
Wed Sep 17 19:10:57 EDT 2008


It could be a bad filter string, what is the value of selectstring when you
pass it to the MgFeatureQueryOptions object?

- Jackie


Suja Sudhan wrote:
> 
> 
> Hello All,
> 
> I am trying to get all the attributes of a layer and below is my code to
> do
> it. It works well for most of the layers but throws MgDateTimeException
> for
> couple of layers at the line of code where the feature reader is populated
> (pl see code below). What should be causing this, anything to do with the
> data?
> 
>             MgMap map = new MgMap();
>             map.Open(resService, mapName);
> 
>             //get the layer for which the attributes have to be got
>             MgLayerBase layer = map.GetLayers().GetItem(layerName);
> 
>             //get the layer class name
>             string layerClassName = layer.GetFeatureClassName();
> 
>             MgSelection selection = new MgSelection();
> 
>             //generate a selection string
>             string selectstring = selection.GenerateFilter(layer,
> layerClassName).ToString();
> 
>             //set the query option required for the reader to populate
>             MgFeatureQueryOptions featQueryOption = new
> MgFeatureQueryOptions();
>             featQueryOption.SetFilter(selectstring);
> 
>             //get the layer resource id
>             MgResourceIdentifier resId = new
> MgResourceIdentifier(layer.GetFeatureSourceId()); ;
>            
>             //populate feature reader
>             MgFeatureReader reader = featService.SelectFeatures(resId,
> layerClassName, featQueryOption);
> 
> The code throws MgDateTimeException (message: A date and/or time exception
> occurred.) at the above line.
> 
> Thanks,
> Suja
> -- 
> View this message in context:
> http://www.nabble.com/MgDateTimeException-tp19465653p19465653.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/MgDateTimeException-tp1086509p1096857.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list