Server Error in '/' Application.

Cannot find table 1.

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 1.

Source Error:


Line 150:        {
Line 151:            DataTable dtType = ds.Tables[0] as DataTable;
Line 152:            DataTable dtStats = ds.Tables[1] as DataTable;
Line 153:            foreach (DataRow dr in dtType.Rows)
Line 154:            {

Source File: h:\root\home\maulikkheradiya-001\www\iplstats\StatsPage.aspx.cs    Line: 152

Stack Trace:


[IndexOutOfRangeException: Cannot find table 1.]
   System.Data.DataTableCollection.get_Item(Int32 index) +81
   StatsPage.FillStats(String staturl, String year, String leaguename) in h:\root\home\maulikkheradiya-001\www\iplstats\StatsPage.aspx.cs:152
   StatsPage.Page_Load(Object sender, EventArgs e) in h:\root\home\maulikkheradiya-001\www\iplstats\StatsPage.aspx.cs:39
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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