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 18: 		{
Line 19: 			sqlDR.Read();
Line 20: 			titleTxt.Text = sqlDR["title"].ToString();
Line 21: 			pageTxt.Text = sqlDR["bodyText"].ToString();
Line 22: 

Source File: d:\osco.uk.com\Products.aspx.cs    Line: 20

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) +2748235
   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
   About.Page_Load(Object sender, EventArgs e) in d:\osco.uk.com\Products.aspx.cs:20
   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.4063.0