Solved

Where to look for the cause of a System.IndexOutOfRangeException

Posted on 2008-10-02
2
277 Views
Last Modified: 2013-12-17
I have web application that updates and creates new records in a database. The application was working fine, but now I'm getting an exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.

I did not code this and am not really a strong C# coder, although I can read through the code and understand the basics plus make small changes. I do not have any arrays in this particular page (that I can find).
Any suggestions on where to start troubleshooting this?

Thanks
0
Comment
Question by:Jgbyrd
2 Comments
 
LVL 10

Accepted Solution

by:
Marcjev earned 250 total points
ID: 22628039
Some of the classes you use will have indexes (a collection of some sort).

Simplest thing would be running in the debugger. You could then stop at the error and find the right place the most simple way. Otherwise you should set the options in the application (IIS) to send all errors to de browser, so you would get a  view of the callstack there.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 250 total points
ID: 22628174
you might be using collections, lists means classes from which values/objects can be retrieved by using indexers.
when you do debugging and the error comes then check the stack trace it will give you which function threw the error or even on which line the exception came.

if you can share that information with us we might be able to help you better
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question