A combobox has an event for the change of a selection, e.g. SelectionChanged or SelectedIndexChanged. In the corresponding event handler, get the SelectedItem of the combobox. Caution: it might be "Nothing". If it is not Nothing, query your database to get the regions. Make the regions combobox empty (e.g. comboregions.Items.Clear()), and fill the new data into it. You could then set the SelectedIndex to 0 to preselect the first item in the combobox.
Another option is in the DataSet designer or programmatically, create a relation between Country and Region DataTables like
Relation Name: CountryRegion
Parent Table: Country, primary key: CountryID
Child Table: Region, Foreign key: CountryID
'Now create a BindingSource for Country ComboBoxDim CountryBindingSource AsNew BindingSource(DataSet1, "Country")
'Then create a binding source with CountryBindingSource as the parent using the relation Dim RegionBindingSource AsNew BindingSource(CountryBindingSource, "CountryRegion")
'Now set the DataSource, DisplayMember and ValueMember properties of both the ComboBoxes
comboBox1.DataSource = CountryBindingSource
comboBox1.DisplayMember = "Country"
comboBox1.ValueMember = "CountryID"
comboBox2.DataSource = RegionBindingSource
comboBox2.DisplayMember = "Region"
comboBox2.ValueMember = "RegionID"
I would create a Person class that contains properties for each aspect I will need to group by. Then I could use LinQ to group by any property. For more help you will need to provide more information, I'm afraid.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
I try to run an exe to a windows 2000 but an error occurs The dynamic link library mscoree.dll could not be found in the specified path...
so I put the mscoree.dll to the exe location, but when I try to run the exe again this error appears A fatal error occured. However, mscoree.dll could not be loaded to display the appropriate error message. Please reinstall the .NEt Frameword.
I just installed a .NET Framework on that computer.. don't know why i can't run the exe
Is it because the OS is to old or I have miss something.
I use Microsoft Visual Studio 2005 in this application
Can someone suggest what happened here...
but the program runs fine in Windows XP
The bigger question is why you're still running Windows 2000?? It was end-of-life at LEAST 2 to 6 years ago, depending on workstation or server edition. No security updates or fixes are possible for it anymore.