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 68:             OdbcDataAdapter da = new OdbcDataAdapter("select img_path,rank_value,height,width from page_article_dets where article_id=" + id, con);
Line 69:             da.Fill(dt);
Line 70:             img_url = dt.Rows[0]["img_path"].ToString();
Line 71:             int rankvalue = Convert.ToInt16(dt.Rows[0]["rank_value"]);
Line 72:             int ranksvalue = rankvalue + 1;

Source File: d:\DeccanChronicle\articledetailpage.aspx.cs    Line: 70

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2428913
   System.Data.DataRowCollection.get_Item(Int32 index) +19
   articledetailpage.Page_Load(Object sender, EventArgs e) in d:\DeccanChronicle\articledetailpage.aspx.cs:70
   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.3062.0