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
Nel
NA
716
1.1m
InvalidArgument=Value of '0' is not valid for 'index' error
Feb 8 2012 3:23 AM
Hello,
I have two comboboxes on my windows form. When loading it, I want the second box to display only the values for which one of the fields from the database are the same as the displayed value in the first combobox.
I tried with this code:
command3.CommandText = "Select * from Komintent order by Komintent asc";
command2.CommandText = "Select * from Dogovor where Komintent=? order by Brdog"; //I use this command to fill the second combobox
command2.Parameters.AddWithValue("@Komintent", comboBox3.Items[0]);
and I got this error:
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
in the bold line above.
Could anybody please help me how to display only filtered data in the second combobox?
Thank you very much in advance.
Reply
Answers (
8
)
I guess my thread got deleted lolz . Classes and objects help
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." error when combobox selected index changed