Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

any idea

Posted on 2016-11-07
3
Medium Priority
?
67 Views
Last Modified: 2016-11-26
Any idea on how to fix this in vb?

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]


Message: Out of Range
Error Status: 500
Error Number: 385040
Error Type: System.ArgumentOutOfRangeException
0
Comment
Question by:shwelopo
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 1000 total points (awarded by participants)
ID: 41877106
You're looking for an item in a list by its index number.  The number you're using is not a valid list index.  That could be for any number of reasons, and there's not enough information here to say why.

Start by verifying the length (how many items are in the list) of the list.  Then verify the index you're looking for.
1
 
LVL 64

Assisted Solution

by:Fernando Soto
Fernando Soto earned 1000 total points (awarded by participants)
ID: 41877149
The best that can be said about this is that you are attempting to access an Array or List or some object that takes an index but the index you are attempting to use is outside the valid range. For example if you have an array that can be accessed with and index between 0 and 100 the only valid indexes that can be used in any integer between 0 and 100 inclusive, so using an index of -1 or 101 fall outside the valid range and will give the error you are getting.

Please post the code where this error is happening.
1
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 41902206
Both solutions would be where to look with this error.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

772 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