Server Error in '/BSUJournals' 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 133:          dan.Fill(contentDT);
Line 134:          DataView contentView = new DataView(contentDT);
Line 135:          DataRowView contentRow = contentView[0];
Line 136:          DataTable typeDT = new DataTable();
Line 137:          string typeQury = "SELECT * from [PaperType] where id='" + contentRow["PaperTypeId"] + "'";

Source File: e:\New Web\New Website\Website333\BSUWebsite\BSU\BSUWebSite\BSUJournals\Content.aspx.cs    Line: 135

Stack Trace:


[IndexOutOfRangeException: Index 0 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +2147855
   System.Data.DataView.get_Item(Int32 recordIndex) +16
   Content.ShowPaperContent(String id) in e:\New Web\New Website\Website333\BSUWebsite\BSU\BSUWebSite\BSUJournals\Content.aspx.cs:135
   Content.Page_Load(Object sender, EventArgs e) in e:\New Web\New Website\Website333\BSUWebsite\BSU\BSUWebSite\BSUJournals\Content.aspx.cs:79
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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