473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sporadic Error: Cannot find table 0

The application is developed in ASP.Net with a SQL Server database.

Essentially, the application uses a single shared Connection object for
all users logged into the system. The connection object is
opened/closed for each transaction.

The error - System.IndexOut OfRangeExceptio n: Cannot find table 0 -
occurs on one page that accepts a single piece of data from a textbox.
This data is then passed to the business logic classes (in VB.Net) and
is queried against the database.

According to the stack trace, the error occurs at:
System.Data.Dat aTableCollectio n.get_Item(Int3 2 index) +79

Out of 100 data entries, this error will appear once or twice. Note
also that when the user enters the same piece of data that caused the
initial run-time error, the second entry executes OK!
Any suggestions?

Thanks:

Pat

Nov 19 '05 #1
3 4262
Pat:
You haven't provided nearly enough information to successfully diagnose the
problem. Somewhere you have a dataset where you are doing something like:

dim dt as DataTable = ds.Tables(0)

or

ds.Tables(0).[SOMETHING]

but ds.Tables(0) isn't a valid table..it's null/nothing and when you try to
access it an index out of range.

While I don't think the shared connection is necessarily a problem in this
case, depending on how it's implemented, this could likely cause you other
types of problems down the road...again, just assuming without seeing any
code.

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"POL8985" <po*****@njit.e du> wrote in message
news:11******** ************@c1 3g2000cwb.googl egroups.com...
The application is developed in ASP.Net with a SQL Server database.

Essentially, the application uses a single shared Connection object for
all users logged into the system. The connection object is
opened/closed for each transaction.

The error - System.IndexOut OfRangeExceptio n: Cannot find table 0 -
occurs on one page that accepts a single piece of data from a textbox.
This data is then passed to the business logic classes (in VB.Net) and
is queried against the database.

According to the stack trace, the error occurs at:
System.Data.Dat aTableCollectio n.get_Item(Int3 2 index) +79

Out of 100 data entries, this error will appear once or twice. Note
also that when the user enters the same piece of data that caused the
initial run-time error, the second entry executes OK!
Any suggestions?

Thanks:

Pat

Nov 19 '05 #2
Thank you, Karl, for your help.

Technically, the IndexOutOfRange Exception should never occur because
the data being entered in the ASPX page is actually in the database
(and should return the corresponding set of records in my
DataSet.Table(0 ))! We've actually never paid explicit attention to
connection pooling and hope this would be key to solving our problem.

Allow me to give you a bit more background into the application.

The ASP.Net application references two DLLs that provide 100% of the
business logic. Each of these DLLs performs all SQL Server
transactions via a data access class we wrote. Each DLL has one global
instance of this data access class (with the same connection string).
The data access class uses a single connection object that is
open/closed with each transaction.

I know that connection pooling is automatically handled by ADO.Net, but
how would I explicitly use it to solve this problem?
Thanks again:

Pat

Nov 19 '05 #3
Pat,
I'm still not sure that the problem isn't simple logic (as in the record
doesn't exist), but as I said, depending on how your data access class is
handled within your two business layers, there could certainly be problems.

First of all, the fact that you have 2 assemblies for your business layer,
each having a separate instance of the data access class isn't likely an
issue, so let's simplify it and say you have 1 assembly (dll) for your
business logic which has a global data access class instace

If your global data access class instance is shared/static and you aren't
implementing some type of locking, you risk having problems (you most
certainly will actually). Remember, ASP.Net is a multithread environment,
and each request will be serviced by an individual thread. however,
shared/static variables are shared by all threads, so two or more threads
(if more than 1 user requests a page) might try to open the same connection,
then one might close it before the other is finished with it. All this
depends a lot on how you are managing the instance within your business
assembly as well as what the data access class itself does. However, if you
haven't considered this, simply creating a new instance of the data access
class as needed might resolve your problem. That is, don't have a
global/shared one, create and dispose as needed. This is how to best allow
ADO.Net's connection pooling to work, open connections as late as possible
and close them as soon as possible. You might be doing this, but if it's in
a shared/static instance, you'll run into threading problems.

Going back to the first issue, have you tried to capture the user inputs for
when the exception is generated? Just incase the error is logical?

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"POL8985" <po*****@njit.e du> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Thank you, Karl, for your help.

Technically, the IndexOutOfRange Exception should never occur because
the data being entered in the ASPX page is actually in the database
(and should return the corresponding set of records in my
DataSet.Table(0 ))! We've actually never paid explicit attention to
connection pooling and hope this would be key to solving our problem.

Allow me to give you a bit more background into the application.

The ASP.Net application references two DLLs that provide 100% of the
business logic. Each of these DLLs performs all SQL Server
transactions via a data access class we wrote. Each DLL has one global
instance of this data access class (with the same connection string).
The data access class uses a single connection object that is
open/closed with each transaction.

I know that connection pooling is automatically handled by ADO.Net, but
how would I explicitly use it to solve this problem?
Thanks again:

Pat

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1725
by: Svetlana Syrkin | last post by:
Sporadically, our clients receive "page cannot be displayed" error. Failure does not occur at the same line, but error code and description are always the same: Microsoft VBScript runtime (0x800a0046) Permission denied After client refresh the page, information displays without any problems. We started to experience this issue after...
1
2783
by: Travis | last post by:
I have state server running on my webserver. It works fine MOST of the time but frequently I get this error while it is running Error Message: Unable to make the session state request to the session stat server. Please ensure that the ASP.NET State service is started and that th client and server ports are the same. If the server is on a...
3
1313
by: sameer | last post by:
Hi All, i have an asp.net application which has got sql server 2000 behind the scenes. Very simple application, all it does is extract the data from the databse and display it in the grid. But randomly when i access my website in productin ,i get this error mentioned below but when it hit on refresh the website comesup. My website is...
0
1214
by: Petemo94 | last post by:
Folks, I am getting a "sporadic" exception that contains the following stack trace. I say sporadic b/c my DB connection usually works fine, but occasionally it fails. *** I also noted that the folder: *** C:\Documents and Settings\MyServerName\ASPNET\Local Settings\Temp
1
8766
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection object is opened/closed for each transaction. The error - System.IndexOutOfRangeException: Cannot find table 0 - occurs on one page that accepts a...
3
2872
by: Michel Couche | last post by:
Hello, I have an ASP.Net application that uses the Wizard control to build a newsletter. There are three steps in the wizard. The customer's specific design data are loaded from a database in step 1 of the wizard and saved into a session variable. In step 2, when the user clicks on a button, I load the design data from the session...
1
2015
by: Stefan Braumeister | last post by:
Hi NG, I got some difficult problem that drives me nuts. I wrote a relatively simple extension that reads binary files and extracts some data. If I call the script, that uses my extension via webbrowser, apache sometimes segfaults with: *** glibc detected *** free(): invalid next size (normal): 0x0000555555a7c240 ***
3
1625
by: Daniel Rindt | last post by:
Hello List, i hope to find an answer here, my problem is that my Webserver sporadic offers php scripts for download. I search with google and find some issues belonging to php version 4.x and not to my version. Im using php-5.1.6-1.1 (mod_php) with httpd-2.0.54-10.4 and can not find informations belonging to my versions. so i hope someone...
10
6945
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114....
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.