Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid

Status
Not open for further replies.

vlad123

Programmer
Jun 22, 2005
37
DE
Hi,
I have a form with 2 comboboxes and one datagrid. I want to use these 2 comboboxes to filter the information from datagrid.

I have in the first combo all countries from table country
in the second one: all cities from the country that is selected in the first combo (table city)

I want in the grid to see all clients from a city that I select in the second combo.

my tables are: country, city, client

until now I can see in the grid all my records without filter. I used dataset and dataadapter and relations but I dont know where should I put WHERE clause.
in my dataadapter i have (select * from country)for every of them
in relation: ds.Relations.Add("country_id", ds.Tables!country.Columns!country_id, ds.Tables!city.Columns!country_id)
("select city from city inner join country on country.country_id = city.country_id where country.country = '" & Me.cboCountry.SelectedItem & "'")

thanks!

 
Hi,

Maybe you should consider using a dataview as the datasource of your datagrid and apply a rowfilter on it according to the content of your comboboxes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top