Solved

ArgumentOutOfRangeException: StartIndex cannot be less than zero.

Posted on 2013-10-24
6
2,469 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39598033
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
ID: 39598295
Thanks,

Here is the code.

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

Expert Comment

by:Fernando Soto
ID: 39598360
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
What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

 

Author Comment

by:Dovberman
ID: 39599059
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 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39599353
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
ID: 39600062
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

621 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