Server Error in '/' Application.

Invalid attempt to access a field before calling Read()

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: MySql.Data.MySqlClient.MySqlException: Invalid attempt to access a field before calling Read()

Source Error:


Line 106:            reader.Read()
Line 107:            'Console.WriteLine(reader(0).ToString())
Line 108:            Titulo = reader("manchete").ToString
Line 109:            Resumo = reader("textocurto").ToString.Replace(Chr(13), "").Replace(Chr(10), "")
Line 110:            If Resumo.Length > 255 Then

Source File: E:\home\folhapopul1\folhapopular.net.br\web\noticia.ascx.vb    Line: 108

Stack Trace:


[MySqlException (0x80004005): Invalid attempt to access a field before calling Read()]
   MySql.Data.MySqlClient.ResultSet.get_Item(Int32 index) +229
   MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull) +38
   MySql.Data.MySqlClient.MySqlDataReader.GetValue(Int32 i) +66
   MySql.Data.MySqlClient.MySqlDataReader.get_Item(Int32 i) +10
   MySql.Data.MySqlClient.MySqlDataReader.get_Item(String name) +27
   noticia.GetNewsData() in E:\home\folhapopul1\folhapopular.net.br\web\noticia.ascx.vb:108
   noticia.Page_PreRender(Object sender, EventArgs e) in E:\home\folhapopul1\folhapopular.net.br\web\noticia.ascx.vb:572
   System.Web.UI.Control.OnPreRender(EventArgs e) +9872798
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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