Click here to Skip to main content
15,561,685 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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

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

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.
Share this answer
Sergey Alexandrovich Kryukov 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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900