|
-
Combo Box Problem
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:
Code:
cboCompanies.DataSource = Ds.Tables("tblCompanies")
cboCompanies.DisplayMember = "CompanyName"
cboCompanies.ValueMember = "CompanyId"
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
Code:
Ds.Tables("tblYearsOnline").DefualtView.RowFilter = IIF(cboCompanies.Text.Length
= 0,0,cboCompanies.SelectedValue
cboYears.DataSource = Ds.Tables("tblYearsOnline").DefaultView
cboYears.DisplayMember = "YearsOnLine"
cboYears.ValueMember = "YearsOnLine"
THIS IS NOT WORKING..WHAT SHOULD I DO??..PLEASE HELP ME??..I am really frustrated!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks