Server Error in '/' Application.

Cannot find table 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: Cannot find table 0.

Source Error:


Line 94:         int total = 0;
Line 95:         DataSet ds = com.GetTotalAgendaListeByTypeId(1, 2);
Line 96:         foreach (DataRow dr in ds.Tables[0].Rows)
Line 97:         {
Line 98:             total = int.Parse(dr[0].ToString());

Source File: d:\inetpub\vhosts\cityzens-25.package\cityzens.fr\wwwroot\agenda\afterwork-paris\afterwork-soirees-paris.aspx.cs    Line: 96

Stack Trace:


[IndexOutOfRangeException: Cannot find table 0.]
   System.Data.DataTableCollection.get_Item(Int32 index) +114
   agenda_afterwork_paris_afterwork_soirees_paris.CalculTotalRecords() in d:\inetpub\vhosts\cityzens-25.package\cityzens.fr\wwwroot\agenda\afterwork-paris\afterwork-soirees-paris.aspx.cs:96
   agenda_afterwork_paris_afterwork_soirees_paris.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\cityzens-25.package\cityzens.fr\wwwroot\agenda\afterwork-paris\afterwork-soirees-paris.aspx.cs:32
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082


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