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 53: "WHERE (((STUFF.CATEGORIA_PRINCIPAL)=5)) ORDER BY STUFF.DATA_CRIACAO DESC;"
Line 54:         Dim dt As DataTable = AcessoBD.CreateDataTable(nsql)
Line 55:         Dim r As DataRow = dt.Rows(0)
Line 56:         get_last_news = r("IDSTUFF").ToString
Line 57:     End Function

Source File: C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\coluna.aspx.vb    Line: 55

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +1559118
   System.Data.RBTree`1.get_Item(Int32 index) +19
   System.Data.DataRowCollection.get_Item(Int32 index) +11
   view.get_last_news() in C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\coluna.aspx.vb:55
   view.carrega_noticia(String id) in C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\coluna.aspx.vb:36
   view.Page_Load(Object Sender, EventArgs E) in C:\Inetpub\vhosts\itaquera.com.br\httpdocs\aspnet_client\coluna.aspx.vb:29
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175