HI..I have the following table
YearsOnline..it has three columns
CompanyId Year
------------- -----
1 2000
1 2001
2 2000
I have two combo boxes..cboCompany and cboYears
In the LOAD event of the form I do the following :
I fill two tables in a dataset..tblCompanies and tblYearsOnline
and i populate the cboCompanies as follows:
SO I need to POPULATE THE SECOND Combo Box with the years RELATED to the
company in the FIRST combo box...
So I tried to put the following code in the cboCompanies.SelectedIndexChanged
event handler
THIS IS NOT WORKING..WHAT SHOULD I DO??..PLEASE HELP ME??..I am really frustrated!!!
09-17-2002, 08:49 AM
RealGuru
Re: Combo Box Problem
It is giving an error that it is filling the CompanyId in the RowFIlter statment
with the following "System.Data.DataRowView".
The event is getting triggered in the load event!!...before it is even shown!!
09-17-2002, 09:03 AM
Phil Weber
Re: Combo Box Problem
> THIS IS NOT WORKING...
Retina: How is it "not working?" Do you get an error message? If so, what does
it say, and on which line does it occur?
--
Phil Weber
09-17-2002, 09:07 AM
PWilmarth
Re: Combo Box Problem
I'm not sure from your example when you are calling the fill method for your
data adapter. Until you fill your Data Adapter, you will see this message.
I'm not sure when, in your code, want to fill your combobox. I worked through
a combobox problem last week, and that message tells me you have everything
connected correctly, but you need to fill the Data Adapter.
09-17-2002, 10:13 AM
Re: Combo Box Problem
I'm finding that lot's of folks are having this problem. Here is a summary
of what you need to do to have a properly functioning combobox or list box.
1. Establish your connection
2. Add a Data Adapter
3. Generate your SQL commands
4. Add a Data Set
5. Fill your Data Adapter
6. Bind your data.
Data binding with comboboxes or listboxes are complex. You can either use
the properties window (DataSource =, DataView =) or you can do it with code:
with combobox
.datasource =
.dataview =
end with
09-17-2002, 10:15 AM
Re: Combo Box Problem
Sorry,code should be this:
Code should be this:
with combobox
> .datasource =
> .displaymenber =
>end with
>
09-18-2002, 01:23 AM
RealGuru
Re: Combo Box Problem
The tables are getting FILLED with data adapters FINE!..
no problem in that so I removed that part of the code..I am filling two tables
in my dataset which are tblCompanies and tblYearsOnline