Server Error in '/' Application.

Invalid attempt to read when no data is present.

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.InvalidOperationException: Invalid attempt to read when no data is present.

Source Error:


Line 301:                        Dim mainimageReader2 As SqlDataReader = RESI.Global.dbConn.Read("EXEC wsp_GetSelectedCommunityDetailsBySubdivisionID '" + subdivision_Id + "',1", 0)
Line 302:                        If (mainimageReader2.HasRows()) Then
Line 303:                            SubdivisionImage = "<img src=""" + mainimageReader2("PHOTO_URL") + """ alt=""" + Subdivision_Name + """ class=""resultThumb"" />" 
Line 304:                        End If
Line 305:                        mainimageReader2.Close()

Source File: d:\resiwebs\abescondos.com\mobile\contact-us.aspx    Line: 303

Stack Trace:


[InvalidOperationException: Invalid attempt to read when no data is present.]
   System.Data.SqlClient.SqlDataReader.CheckDataIsReady(Int32 columnIndex, Boolean allowPartiallyReadColumn, Boolean permitAsync, String methodName) +2748411
   System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean setTimeout, Boolean allowPartiallyReadColumn) +54
   System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i) +41
   System.Data.SqlClient.SqlDataReader.GetValue(Int32 i) +92
   ASP.contact_us_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\resiwebs\abescondos.com\mobile\contact-us.aspx:303
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   inc_masterpage.Render(HtmlTextWriter writer) in d:\resiwebs\abescondos.com\mobile\App_Code\inc-masterpage.vb:20
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753


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