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 364:        DataSet ds = Utility.ReturnFields(theSQL);
Line 365:        DataRow dr;
Line 366:        if (ds.Tables[0].Rows.Count > 0)
Line 367:        {
Line 368:            int i = 0;

Source File: g:\pleskvhosts\bakewaybakery.com\httpdocs\NC\App_Code\PhotoManage.cs    Line: 366

Stack Trace:


[IndexOutOfRangeException: Cannot find table 0.]
   System.Data.DataTableCollection.get_Item(Int32 index) +92
   PhotoManage.GetAlbums() in g:\pleskvhosts\bakewaybakery.com\httpdocs\NC\App_Code\PhotoManage.cs:366
   Albums.Bind_Grid() in g:\pleskvhosts\bakewaybakery.com\httpdocs\NC\Albums.aspx.cs:29
   Albums.Page_Load(Object sender, EventArgs e) in g:\pleskvhosts\bakewaybakery.com\httpdocs\NC\Albums.aspx.cs:23
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   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.9061; ASP.NET Version:2.0.50727.9062