Click here to Skip to main content
12,350,346 members (27,704 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#3.0 C#
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`
Query:

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


Thanks
Posted 26-Jan-12 21:15pm
KIDYA754
Comments
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
 
good
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.
  Permalink  
Comments
SAKryukov 27-Jan-12 3:27am
   
Exactly, a 5.
--SA
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


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2016
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