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 32:                                     tbl_Faculty.PAGE_ID, tbl_Faculty.faculty_order, tbl_Faculty.filepath,tbl_Faculty.faculty_user_type,tbl_Faculty.faculty_password,tbl_Faculty.faculty_Status ,
Line 33:                                     TBL_PAGE.PAGE_NAME FROM tbl_Faculty INNER JOIN TBL_PAGE ON tbl_Faculty.PAGE_ID = TBL_PAGE.PAGE_ID WHERE faculty_id=@faculty_id ORDER BY faculty_order, tbl_Faculty.faculty_id", sp);
Line 34:             lbl_user.Text = dt.Rows[0]["faculty_name"].ToString();
Line 35:             lbl_user1.Text = dt.Rows[0]["faculty_name"].ToString();
Line 36: 

Source File: c:\inetpub\vhosts\govtcccollegepatan.in\httpdocs\FacultyProfile.aspx.cs    Line: 34

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2136731
   System.Data.DataRowCollection.get_Item(Int32 index) +21
   FacultyProfile.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\govtcccollegepatan.in\httpdocs\FacultyProfile.aspx.cs:34
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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