Combobox Population Based On Each Other Sql C#
i have 2 boxes, i'd like to populate the 1st from sql and the 2nd based on the first (querying sql too) public void Country() { using (SqlConnection conn = new SqlConn
Solution 1:
SELECTDISTINCT CityName FROM City where CountryName =@CountryNameChange the select statement with where clause as above,then you can set the parameter value using this.country.SelectedValue
You can load the second combobox on first combobox selelected index changed event. Call the City() inside first combobox selected index changed event with the where condition to filter city based on country
few links for related code:
Post a Comment for "Combobox Population Based On Each Other Sql C#"