Sql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HashPe
    New Member
    • Mar 2009
    • 4

    #1

    Sql

    so, i have some troubles
    i have 2 tables
    one is countries with fields:
    id_Country
    and Country
    the second table is cities with tables:
    Id_City
    id_Country
    and City

    i have two combobox-es:
    DisplayMembers in the first one are Country from Countries and MemberValue is id_Country
    ...
    my question is:
    How do I populate the second combobox with Cities where the City.id_Country is the selected value from the first Combobox?
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    #2
    use if statements, unique country get a unique sql statement say if country = 1 then city = "select city from db where countryid = 1 else if country = 2 then city = "select city from db where countryid = 2

    Comment

    Working...