locked
System.IndexOutOfRangeException: Cannot find table 0.

    Question

  • Hi,

    I need some help. I'm fairly new to Visual studio and coding in general. 

    I built a small web application that reads from an access database. The application works great on my localhost. When I deploy the app to the server, it throws an error.

    Error:

    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: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    What am I doing wrong? If everything is connected in the localhost, why does it not work on the server? I don't understand. 

    Thursday, July 19, 2012 3:04 PM

All replies

  • hI,

    You have to check  the condition as below code

    if(dataset!null)

    {

       if(dataset.Tables..Count>0)

       {

                   //you code goes here

       }


    PS.Shakeer Hussain

    Thursday, July 19, 2012 3:30 PM