[mapguide-users] MgDateTimeException

Suja Sudhan suja.sudhan at atkinsglobal.com
Fri Sep 12 19:08:00 EDT 2008


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.



More information about the mapguide-users mailing list