queryTask = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/0");
queryTask.ExecuteRelationshipQueryCompleted += QueryTask_ExecuteRelationshipQueryCompleted;
//Relationship query
RelationshipParameter relationshipParameters = new RelationshipParameter()
{
ObjectIds = new int[] { 113880 },
OutFields = new string[] { "*" },
RelationshipId = 3,
ReturnGeometry = false
};
queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);
void QueryTask_ExecuteRelationshipQueryCompleted(object sender, RelationshipEventArgs e)
{
RelationshipResult pr = e.Result;
if (pr.RelatedRecordsGroup.Count == 0)
{
//RelatedRecordsGroup.Count is always zero when query is executed on ArGIS Server 10.21
//But when executed against ArcGIS Server 10.0, RelatedRecordsGroup does contain the related records
}
else
{
foreach (var pair in pr.RelatedRecordsGroup)
{
//Do something
}
}
}{"fields":[...],"relatedRecordGroups":[{"objectId":1,"relatedRecords":[...]}]}{"fields":[...],"relatedRecordGroups":[{"OBJECTID":1,"relatedRecords":[...]}]}{"fields":[...],"relatedRecordGroups":[{"OBJECTID":1,"relatedRecords":[...]}]} very interesting, thanks for the post.
I had to restore my 10.1 Server because of intermittent QueryTask failures on my 10.2.2 trial (using Silverlight API 3.1)
could this be a similar issue? Server Logs were saying failure to convert string 12345.123 to int. but it should be a string and stay a string throughout, and I have no idea what process is trying to convert it into an int.
I try to understand the technology behind all of this but get lost when queries get jammed through so many different formats (JSON syntax as you mention).......