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 OriginalGriff 278
1 Maciej Los 210
2 Nguyen.H.H.Dang 190
3 Peter Leow 175
4 Sergey Alexandrovich Kryukov 150

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