Solved

Where to look for the cause of a System.IndexOutOfRangeException

Posted on 2008-10-02
2
275 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now