Jennifer,
Thank you for your help. I tried the code you sent and still did not get an value for the id. Is it possible that there is something wrong with the map service. The map service was made from a single feature layer in ArcMap 9.3.1 with a relate that works to a table in a file geodatabase. The map service displays correctly. When the user clicks on one of the polygon features the form pops up with the correct fields and the expected value for the polygon that was clicked on. When I click on that value I get an error message about cannot have a null value. Below is the section of code where the error occurs:
//Relationship query
RelationshipParameter relationshipParameters = new RelationshipParameter()
{
ObjectIds = new int[] { Convert.ToInt32(g.Attributes[v_GIS_OPPTY_DETAIL.Tag as string]) },
OutFields = new string[] { "OPPTY_NAME, STAGE_DESC_TEXT, IHS_COUNTRY_NAME, HESS_BASIN_ID, FIRST_NAME_TEXT,LAST_NAME_TEXT " },
RelationshipId = 0,
OutSpatialReference = MyMap.SpatialReference
};
queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);
Any additional help is appreciated.
David Kelly