Server Error in '/' Application.

There is no row at position 0.

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: There is no row at position 0.

Source Error:


Line 4311:        Public Default ReadOnly Property Item(ByVal index As Integer) As Medent_StockRow
Line 4312:            Get
Line 4313:                Return CType(Me.Rows(index),Medent_StockRow)
Line 4314:            End Get
Line 4315:        End Property

Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\cfe0e5f5\d9abd3d4\App_Code.v3_8lpac.10.vb    Line: 4313

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2136515
   System.Data.DataRowCollection.get_Item(Int32 index) +21
   Medent_StockDataTable.get_Item(Int32 index) in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\cfe0e5f5\d9abd3d4\App_Code.v3_8lpac.10.vb:4313
   CartBS.AddNewItem(Int32 ProdID, Int32 Quantity, Int32 QuantityLastOrder) in C:\Website\medent.co.nz\www\App_Code\VB\Medent\CartBS.vb:253
   CartBS.AddItem(Int32 ProdID, Int32 Quantity, Int32 QuantityLastOrder) in C:\Website\medent.co.nz\www\App_Code\VB\Medent\CartBS.vb:218
   CartBS.AddItem(Int32 ProdID, Int32 Quantity) in C:\Website\medent.co.nz\www\App_Code\VB\Medent\CartBS.vb:206
   MedentStore_AddToCart.AddToCart() in C:\Website\medent.co.nz\www\medentstore\AddToCart.aspx.vb:15
   MedentStore_AddToCart.Page_Load(Object sender, EventArgs e) in C:\Website\medent.co.nz\www\medentstore\AddToCart.aspx.vb:8
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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