Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0
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 at 27-Jan-12 3:39am
post your whole code...
KIDYA at 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 at 27-Jan-12 3:27am
Exactly, a 5.
Abhinav S at 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
0 Maciej Los 235
1 OriginalGriff 215
2 Manfred R. Bihy 190
3 CHill60 180
4 _Amy 155
0 OriginalGriff 7,395
1 Sergey Alexandrovich Kryukov 6,163
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,702

Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2014
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