none
Cannot find table 0, cannot find column in table and random errors like that in ASP.NET application RRS feed

  • Question

  • I am running an ASP.NET application. Quite often I am getting random error like the below:

    Cannot find table 0

    Message: cstid is neither a DataColumn nor a DataRelation for table Table.
    StackTrace: at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames) at ASP.default_aspx.__DataBind__control3(Object sender, EventArgs e) in D:\HTTP\myproject.com\Project\default.aspx:line

    Sometimes I get:
    Cannot find table 1
    Cannot find Column of table 0


    Some more messages from stack trace I am pasting here:


    Message: Column 'CategoryName' does not belong to table Table.
    StackTrace: at System.Data.DataRow.GetDataColumn(String columnName) at System.Data.DataRow.get_Item(String columnName) at MyCommunityPortal.forumcategory.BindCategory() at MyCommunityPortal.forumcategory.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Message: Cannot find table 0.
    StackTrace: at System.Data.DataTableCollection.get_Item(Int32 index) at MyCommunityPortal.WebForm1.Bindrecentsignup() at MyCommunityPortal.WebForm1.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    Here are further details to aid in your troubleshooting:

    Local Development Environment is Same as Hosted Environment

    Environment details:

    Windows 2003 Enterprise Edition
    SQL Server 2005 Enterprise Edition (Service Pack 2.0 not installed)
    .NET Framework 2.0

    Our business logic and database connection in class library and we include in main project. We have 8 modules in project and all these modules are projects and compiled in one solution.

    We have not used query in any of the pages, but made use of stored procedures.

    The page sometimes loads properly with dataset and sometimes it throws the errors I mentioned above. Please suggest. Is this something a coding issue or configuration issue or related to IIS-SQL Server.

     

    Here is the sample code of one page that I get error

    Dim objservice As New MyProjectBLogic.MemberLogin '' This is the business logic and database connection dll object
    Dim ds As New Data.DataSet
    ds = objservice.prc_getmyuserdata()
    If ds.Tables(0).Rows.Count > 0 Then
          dlsmemphoto.DataSource = ds.Tables(0)
          dlsmemphoto.DataBind()
          For i = 0 To ds.Tables(0).Rows.Count - 1
                strimg = strimg & ds.Tables(0).Rows(i).Item("mpt_homeblack") & "^"
                strbusiness = strbusiness & ds.Tables(0).Rows(i).Item("cstmissionorgoal") & "^"
                strcity = strcity & ds.Tables(0).Rows(i).Item("citynm") & "^"
                strstate = strstate & ds.Tables(0).Rows(i).Item("statenm") & "^"
                strcountry = strcountry & ds.Tables(0).Rows(i).Item("countrynm") & "^"
                strcustname = strcustname & ds.Tables(0).Rows(i).Item("cstusername") & "^"
                strid = strid & ds.Tables(0).Rows(i).Item("cstid") & "^"
          Next
    End If
    ds = Nothing


     

    Friday, July 6, 2007 9:28 AM

All replies

  • To me it sounds like a coding issue. Is it possible that stored procedures return different set of columns, depending on input or some other logic? If yes, then you could get this type of errors if code expects something else. I would try to log name of the stored procedure application calls and all the parameters (if possible) when exception happens and try to replay it in Query Analyzer/Management Studio
    Friday, July 6, 2007 10:38 AM
    Moderator
  • Hi everyone!

    I'm facing the exact same errors in my ASP.NET application,

    • Column col does not belong to table Table


    • Cannot find table 0


    • Cannot find column col

    randomly the site hangs and the above errors are logged,

    could anyone help me please???
    Wednesday, September 3, 2008 10:38 AM
  • Did you find the solution ?
    Friday, April 22, 2011 6:27 PM
  • Hi,

    Now I facing the same problem also. Have you solved the issues? Thanks

    Friday, May 23, 2014 2:55 AM
  • Someone found the solution?
    Monday, March 20, 2017 3:47 PM