TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Engr Tobi Owoeye
NA
25
0
StartIndex cannot be less than zero.
Jun 4 2012 1:36 PM
Chief Coders,
A listbox with coded items a,b,c,d executes well with these variables but when working with values like CSC456, CSC555, CSC885, or any thing of such it outputs this->error
"StartIndex cannot be less than zero"
"System.ArgumentOutOfRangeException was unhandled
Message=StartIndex cannot be less than zero.
Parameter name: startIndex
Source=mscorlib
ParamName=startIndex
StackTrace:
at Syst"
here is the code:
private string GetRemaining(string strChild, string strParent)
{
for (int i = 0; i < strChild.Length; i++)
{
int nIndex = strParent.IndexOf(strChild[i]);
strParent = strParent.Remove(nIndex, 1);
}
return strParent;
}
it points to this line:
strParent = strParent.Remove(nIndex, 1);
Please any help would be higly appreciated.
Attachment:
apriori.zip
Reply
Answers (
11
)
a small problem, Object reference not set to an instance of an object
Get data from database by month .