Server Error in '/' Application.

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

Source Error:


Line 35:                     adapter.Fill(objDS);
Line 36:                     connection.Close();
Line 37:                     adapter.Dispose();
Line 38:                     if (objDS != null && objDS.Tables.Count > 0)
Line 39:                     {

Source File: C:\Projects\WEBSITE\VPS_Portal\BrokerDotNet\Search\RentPhotos.aspx.cs    Line: 37

Stack Trace:


[IndexOutOfRangeException: Index 0 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +2209560
   BrokerDotNet.Search.RentPhotos.Page_Load(Object sender, EventArgs e) in C:\Projects\WEBSITE\VPS_Portal\BrokerDotNet\Search\RentPhotos.aspx.cs:37
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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