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 278:                    'Get region name & area name by region id & area id
Line 279:                    Dim dtArea As DataTable = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings("con").ConnectionString, CommandType.Text, "select * from PC_Area where Area_Id=" & Convert.ToInt32(Request.QueryString("areaid").ToString())).Tables(0)
Line 280:                    luvinlandURL = luvinlandURL & dtArea.Rows(0)("Area_Name").ToString().Replace(" ", "-")
Line 281:                    Dim dtRegion As DataTable = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings("con").ConnectionString, CommandType.Text, "select * from PC_region where region_Id=" & Convert.ToInt32(Request.QueryString("regionid").ToString())).Tables(0)
Line 282:                    luvinlandURL = luvinlandURL & "-" & dtRegion.Rows(0)("Region_Name").ToString() & "-andalucia"

Source File: C:\Inetpub\vhosts\dev.inlandandalucia.com\httpdocs\propsearch.aspx.vb    Line: 280

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2439357
   System.Data.DataRowCollection.get_Item(Int32 index) +19
   propsearch.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\dev.inlandandalucia.com\httpdocs\propsearch.aspx.vb:280
   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.3690.0