Solved

ArgumentOutOfRangeException: StartIndex cannot be less than zero.

Posted on 2013-10-24
6
2,184 Views
Last Modified: 2013-10-25
I have no idea where this comes from.
Please help.
Thanks

StartIndex cannot be less than zero.
Parameter name: startIndex
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 Exception Details: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex

Source Error:


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:



[ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +14122860
   StockProNew1.Admin.ManageQuoteHist.Page_Load(Object sender, EventArgs e) +1196
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
0
Comment
Question by:Dovberman
  • 3
  • 2
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
Hi Dovberman;

Without the code where the exception happened it is difficult to tell you where the error is. But from the error the variable StartIndex is holding an invalid value which is outside the legal range. Post your code so we can help you.
0
 

Author Comment

by:Dovberman
Comment Utility
Thanks,

Here is the code.

This error occurs on the host server, but not on my local machine.
StartIndex.txt
0
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
I see nothing on that file that has a variable called StartIndex. Can you identify the codepage where the exception is thrown on and try to find the line that it is happening on and post that information please.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Dovberman
Comment Utility
There is no variable in the entire solution that has the name StartIndex.

I found this reference:

http://forums.asp.net/t/1407010.aspx

However, I do not understand the explanation.
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
Set a breakpoint on every line that has a Substring call. You are passing an invalid index to one of them, you just need to figure out which one it is.
0
 

Author Closing Comment

by:Dovberman
Comment Utility
I set breaklines to isolate the offending code.

A file name search for *.txt failed because there were no text files in the referenced directory.

Thanks for your help.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video discusses moving either the default database or any database to a new volume.
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…

743 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

15 Experts available now in Live!

Get 1:1 Help Now