954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Wierd Error message.

Ok occasionally I get the following error message on my site
System.String Substring(Int32, Int32)
Error: Length cannot be less than zero. Parameter name: length

here's the wierd part, I don't use that Substring function,
I use System.String Substring(Int32) whose only parameter is start.
So I am getting an error from a function that I am not calling saying that a parameter that I am not passing is less than zero.

Any ideas?

campkev
Posting Pro in Training
484 posts since Jul 2005
Reputation Points: 14
Solved Threads: 19
 

Cosmic rays? No, sorry, no clue! I just thought I'd respond so you know someone read and thought about your post.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

lol

campkev
Posting Pro in Training
484 posts since Jul 2005
Reputation Points: 14
Solved Threads: 19
 

I would have to see the function code. The function you are a not calling.

I am at a loss as well.

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

I would like to see stack trace and the corresponding source code with line numbers. Make sure .PDB file is latest.

I guess it is not easy to reproduce, otherwise debugger would have helped.

padtes
Junior Poster in Training
86 posts since Aug 2009
Reputation Points: 53
Solved Threads: 20
 

It is legal to use one or two integer parameters because these overloads exist in the library: http://msdn.microsoft.com/en-us/library/system.string.substring.aspx

It's possible that there is another call somewhere else? as other have said, we need to see the stack trace :-)

IrishChieftain
Newbie Poster
2 posts since Nov 2008
Reputation Points: 12
Solved Threads: 0
 

This Method Give this error because the number is passed into the arg is negative so it's better to post the code to understand the problem

mahmoud_wow
Newbie Poster
20 posts since Apr 2009
Reputation Points: 11
Solved Threads: 1
 

I really doubt they are going to post the source code for a problem that was posted almost four years ago.

Ezzaral
Posting Genius
Moderator
15,985 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You