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 42: 
Line 43:         Dim dr As DataRow
Line 44:         If ds.Tables(0).Rows.Count > 0 Then
Line 45:             lblMsg.Visible = False
Line 46:             For Each dr In ds.Tables(0).Rows

Source File: D:\SKBPORTAL\PORTAL\GalleryList.aspx.vb    Line: 44

Stack Trace:


[IndexOutOfRangeException: Cannot find table 0.]
   System.Data.DataTableCollection.get_Item(Int32 index) +92
   GalleryList.GenerateTreeView() in D:\SKBPORTAL\PORTAL\GalleryList.aspx.vb:44
   GalleryList.Page_Load(Object sender, EventArgs e) in D:\SKBPORTAL\PORTAL\GalleryList.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.3623; ASP.NET Version:2.0.50727.3618