Server Error in '/ADRI' Application.

Index was outside the bounds of the array.

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 was outside the bounds of the array.

Source Error:


Line 140:                    DataRow[] dr1 = ds.Tables["RESEARCH_INTEREST"].Select();
Line 141:                    ResearchInterests res = new ResearchInterests();
Line 142:                    res.title = dr1[0]["TITLE"].ToString();
Line 143:                    res.description = dr1[0]["DESCRIPTION"].ToString();
Line 144:                    res.picname = dr1[0]["PICNAME"].ToString();

Source File: e:\inetpub\Web Applications\Adri Van Duin Research Group\App_Code\DataAccessLayer\ResearchInterestsDB.cs    Line: 142

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   AdriManager.Dal.ResearchInterestsDB.GetResearchInterestsById(Int32 id) in e:\inetpub\Web Applications\Adri Van Duin Research Group\App_Code\DataAccessLayer\ResearchInterestsDB.cs:142
   AdriManager.Bll.ResearchInterestsManager.GetResearchInterestsById(Int32 id) in e:\inetpub\Web Applications\Adri Van Duin Research Group\App_Code\BusinessLogic\ResearchInterestsManager.cs:41
   ResearchImage.Page_Load(Object sender, EventArgs e) in e:\inetpub\Web Applications\Adri Van Duin Research Group\ResearchImage.aspx.cs:26
   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.4087.0