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 317:            Label lblZoom = (Label)e.Row.FindControl("lblZoom");
Line 318:            dtimage = objProdImages.ProdImages_GetAll(DataBinder.Eval(e.Row.DataItem, "PD_Id").ToString(), "PI_SortOrder");
Line 319:            lblZoom.Text = "<a id='hrefImg' href='uploads/" + dtimage.Rows[0]["PI_Image"].ToString() + "' class='jqzoom' rel='gal1' title='" + DataBinder.Eval(e.Row.DataItem, "PD_Title").ToString() + "'><img id='imgProd'  border=\"0\" src='MakeThumbnail.aspx?file=" + dtimage.Rows[0]["PI_Image"].ToString() + "&w=231&h=400'  /></a>";
Line 320:            lblImages.Text += "<ul id=''>";
Line 321:            for (int i = 0; i < dtimage.Rows.Count; i++)

Source File: d:\inetpub\vhosts\erp.perform.co.in\perform.co.in\ProductsViewmore.aspx.cs    Line: 319

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2140712
   System.Data.DataRowCollection.get_Item(Int32 index) +22
   ProductsViewmore.gdProduct_OnRowDataBound(Object sender, GridViewRowEventArgs e) in d:\inetpub\vhosts\erp.perform.co.in\perform.co.in\ProductsViewmore.aspx.cs:319
   System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e) +116
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +184
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3839
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +15
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +133
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.GridView.DataBind() +10
   ProductsViewmore.ProductBind() in d:\inetpub\vhosts\erp.perform.co.in\perform.co.in\ProductsViewmore.aspx.cs:146
   ProductsViewmore.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\erp.perform.co.in\perform.co.in\ProductsViewmore.aspx.cs:98
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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