Select to view content in your preferred language

IndexOutofRangeExpection when solved the routing

2508
1
01-19-2011 09:01 PM
ZaheerHaider
Emerging Contributor
Hello all,

when i passed stop point of a route the exception through index was outside the bounds of the array. even its under 0


           GraphicsLayer routeGraphicsLayer = MyMap.Layers["MyRouteGraphicsLayer"] as GraphicsLayer;
            routeGraphicsLayer.Graphics.Clear();

            RouteResult routeResult = e.RouteResults[0]; ===> Error: IndexOutofRangeExpection
            routeResult.Route.Symbol = RouteSymbol;
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
The IndexOutofRangeException here means the RouteTask has completed with an empty result, index 0 was not accessible. It's hard to tell were it may have failed but if you try to run Fiddler with your application, you might be able to see the web requests. Check the parameters sent with your request and try to see if making this request through your web browser can yield to the same empty result.
0 Kudos