Click here to Skip to main content
12,951,971 members (61,617 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All,

I am using following query and came across an error
Index and count must refer to a location within the string.It is non reproducible.
 Parameter name: count`


select * from tblstoragemedia where tblstoragemedia.Name = 'Name1' order by recStartTime

Posted 26-Jan-12 21:15pm
amitgajjar 27-Jan-12 3:39am
post your whole code...
KIDYA 27-Jan-12 5:11am
I think i got an error from following code...Is it possible if i pass blank string to .remove funcion it will thr' same error

String[] TimeArray = timezoneOffset.Split(':');
Int32 hrs = Convert.ToInt32(TimeArray[0].Remove(0, 1).ToString());
Int32 mins = Convert.ToInt32(TimeArray[1].ToString());
TimeSpan TimeSpan = new TimeSpan(Convert.ToInt32(hrs), Convert.ToInt32(mins), 0);

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This error probably has nothing to do with the query.
You get such an error when you invoke a method on the String object with a parameter or index that is actually not available in the string.
SAKryukov 27-Jan-12 3:27am
Exactly, a 5.
Abhinav S 27-Jan-12 3:28am
Thank you SA.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100