Below is my code to get features to a feature reader and then to add it to a selection. The below code works for SDF data but not for features coming from an oracle connection. I haven't tested for other connections. Am I missing something?
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
string selectionXML="";
MgMap map = new MgMap();
map.Open(resService, MapName);
MgLayerBase layer = map.GetLayers().GetItem(LayerName); string layerClassname = layer.GetFeatureClassName();
MgResourceIdentifier resId = new MgResourceIdentifierlayer.GetFeatureSourceId());
string QueryString;
MgSelection selection = new MgSelection(map);
for (int j = 0; j < fSel.Count; j++)
{
QueryString = fSel.ToString();
MgFeatureQueryOptions QueryOption = new MgFeatureQueryOptions();
QueryOption.SetFilter(QueryString);
MgFeatureReader featureReader = featureService.SelectFeatures(resId, layerClassname, QueryOption);
//nothing is added to the selection in the below line although the feature reader
// has records (Verified) and this happens only for the data coming from oracle
//I have also replaced fsel.count with 0, but doesn't seem to have an effect.
selection.AddFeatures(layer, featureReader, fSel.Count);
}
selectionXML = selection.ToXml();
return selectionXML;
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Can someone point me what might go wrong here?
Thanks,
Suja