Server Error in '/' Application.

Index -1 is either negative or above rows count.

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 -1 is either negative or above rows count.

Source Error:


Line 27:         // Bind the paged xml data to the DataList
Line 28:         MyDataList.DataSource = MyPDS;
Line 29:         MyDataList.DataBind();
Line 30: 
Line 31:     }

Source File: d:\hshome\lezotte\ccrbike.com\Details.cs    Line: 29

Stack Trace:


[IndexOutOfRangeException: Index -1 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +5036711
   System.Data.DataView.System.Collections.IList.get_Item(Int32 recordIndex) +12
   System.Web.UI.WebControls.EnumeratorOnIList.get_Current() +30
   System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +419
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +64
   System.Web.UI.WebControls.BaseDataList.DataBind() +55
   Details.Page_Load(Object sender, EventArgs e) in d:\hshome\lezotte\ccrbike.com\Details.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1031