Solved

any idea

Posted on 2016-11-07
3
40 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 250 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 63

Assisted Solution

by:Fernando Soto
Fernando Soto earned 250 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 63

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

713 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