Server Error in '/' Application.

Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 54: 
Line 55:         DataRow[] dr = dsIntern.Tables["dtCity"].Select("CityID = '" + searchedID + "'");
Line 56:         toReturn = dr[0].GetParentRow("RegionChild")["RegionName"].ToString().Substring(5) + " - " + dr[0]["CityName"].ToString();
Line 57:         
Line 58:         return toReturn;

Source File: c:\inetpub\cvroot\App_Code\RegionCity.cs    Line: 56

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   RegionCity.GetValue(String searchedID) in c:\inetpub\cvroot\App_Code\RegionCity.cs:56
   ctrl_ctrlQ180.HandleConsulter() in c:\inetpub\cvroot\ctrl\ctrlQ180.ascx.cs:84
   ctrlQuestionBase.Initialisation() in c:\inetpub\cvroot\App_Code\ctrlQuestionBase.cs:108
   ctrlQuestionBase.Page_PreRender(Object sender, EventArgs e) in c:\inetpub\cvroot\App_Code\ctrlQuestionBase.cs:37
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnPreRender(EventArgs e) +11152750
   System.Web.UI.Control.PreRenderRecursiveInternal() +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394


Version Information: Microsoft .NET Framework Version:2.0.50727.8806; ASP.NET Version:2.0.50727.8762