As shown in the image below, I need to fetch query mentioned within query section of a layer using ArcObjects in C#.
IDocument doc = ArcMap.Application.Document;
IMxDocument mxDoc = doc as IMxDocument;
IMap map = mxDoc.FocusMap;
ILayer mapLayer = map.get_Layer(0);
IFeatureClass c = (mapLayer as IFeatureLayer).FeatureClass;
-
Comments are not for extended discussion; this conversation has been moved to chat.Mapperz– Mapperz ♦2018年06月18日 21:42:35 +00:00Commented Jun 18, 2018 at 21:42
1 Answer 1
Cast the layer to an IDatalayer2
.
Cast IDataLayer2.DataSourceName
to IQueryTableName
Get the SQL from IQueryTableName.Query
answered Jun 18, 2018 at 17:34
-
Thanks bro. It worked like a charm. Did you check the answer i posted for a question that we were trying to solve. [link]gis.stackexchange.com/questions/286127/…jay– jay2018年06月18日 17:50:23 +00:00Commented Jun 18, 2018 at 17:50
lang-cs