Get Value of joined fields

682
3
08-09-2012 03:20 AM
MichaelBreitfeld
New Contributor
Hello,

how get the value of joined attributtes like

string valueCode = m_currentFeature.get_Value(indexField).ToString();


the index of specific joined field in FeatureClass i get with

        public static int FindAttributeIndexWithJoinedFields(frmKarte form, string layerName, string attributName)
        {
            IFeatureLayer actFeatLyr = (IFeatureLayer)form.axMapControl1.Map.GetLayerByName(layerName);

            ILayerFields fields = (ILayerFields)actFeatLyr;

            return fields.FindField(attributName);

        }


Can you help me, please?
Thank you!
0 Kudos
3 Replies
JamesCrandall
MVP Frequent Contributor
Hello,

how get the value of joined attributtes like

string valueCode = m_currentFeature.get_Value(indexField).ToString();


the index of specific joined field in FeatureClass i get with

        public static int FindAttributeIndexWithJoinedFields(frmKarte form, string layerName, string attributName)
        {
            IFeatureLayer actFeatLyr = (IFeatureLayer)form.axMapControl1.Map.GetLayerByName(layerName);

            ILayerFields fields = (ILayerFields)actFeatLyr;

            return fields.FindField(attributName);

        }


Can you help me, please?
Thank you!


Use IDisplayTable when working with Joins.
0 Kudos
MichaelBreitfeld
New Contributor
Hi jamesfreddyc

                IDisplayTable dispTable = (IDisplayTable)actFeatLyr;
                ITable table = dispTable.DisplayTable;

                IRow row = table.GetRow(feature.OID);
                Debug.Print(row.get_Value(index).ToString());


Thanks you!
Perfect!
0 Kudos
JamesCrandall
MVP Frequent Contributor
Hi jamesfreddyc

                IDisplayTable dispTable = (IDisplayTable)actFeatLyr;
                ITable table = dispTable.DisplayTable;

                IRow row = table.GetRow(feature.OID);
                Debug.Print(row.get_Value(index).ToString());


Thanks you!
Perfect!


Excellent. 

If you mark as answered then it will benefit others who are searching on this topic 😉
0 Kudos