Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have 1 dataset with two tables. One table is a list of states, the second table is a list of counties for each state. The goal is to have two comboboxes. The first combobox contains a list of states bound to the first table. The second combobox contains a list of counties driven by which state was selected in the first combobox.

 

Through code I can:

create and populate the dataset

create a relationship between the tables

bind the state table to the cmbState combobx

bind the counties table to the cmbCounty combbox

 

Through code I can't:

establish the relationship between the comboboxes. I get a complete list of states in the first combobox and a complete list of counties in the second combobox, not a list of counties for the selected states.

 

This is driving me nuts. I can do this through the use of the wizards; creating a connector, DataAdapters, dataset, a relationship, and set the appropriate datasource and the displaymember for the comboboxes but I can't seem to be able to bind the two comboboxes through code.

 

Help is appreciated.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...