Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2703
  • Last Modified:

ArgumentOutOfRangeException: StartIndex cannot be less than zero.

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
Dovberman
Asked:
Dovberman
  • 3
  • 2
1 Solution
 
Fernando SotoRetiredCommented:
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
 
DovbermanAuthor Commented:
Thanks,

Here is the code.

This error occurs on the host server, but not on my local machine.
StartIndex.txt
0
 
Fernando SotoRetiredCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
DovbermanAuthor Commented:
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
 
käµfm³d 👽Commented:
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
 
DovbermanAuthor Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now