Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 136:        // Motor
Line 137:        //DetailsView1.Rows[3].Cells[0].Text = "<div class='showcarDetails'>Motorstørrelse: " + DetailsView1.Rows[3].Cells[0].Text + "</div>";
Line 138:        DetailsView1.Rows[2].Cells[0].Text = "<div class='showcarDetails'>" + DetailsView1.Rows[2].Cells[0].Text + "</div>";
Line 139:
Line 140:        // Image

Source File: d:\web\localuser\vw-speciale.dk\public_html\printcar.aspx.cs    Line: 138

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.ArrayList.get_Item(Int32 index) +12906457
   System.Web.UI.WebControls.DetailsViewRowCollection.get_Item(Int32 index) +15
   Admin_showcar.DetailsView1_DataBound(Object sender, EventArgs e) in d:\web\localuser\vw-speciale.dk\public_html\printcar.aspx.cs:138
   System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +109
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +165
   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.DetailsView.DataBind() +10
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
   System.Web.UI.WebControls.DetailsView.EnsureDataBound() +239
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +76
   System.Web.UI.Control.EnsureChildControls() +97
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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