Danish Habib

Danish Habib

  • NA
  • 694
  • 244.1k

how to read multiple rows and check the checkbox based on

Feb 10 2016 4:47 AM
I have a Page in which  i am assigning Cities to User The user Table is like that (userID(Primary),Name,City(Foreign_Key),Email) 
one user can have multiple cities for that purposes i made another table with name UserCities(Recordid(P),City(Foreign key),User_ID(Foreign_KEY ) 

 UserID City  Email
 1 1
m
The Cities are present in their own table like   
(CityID(P),CITYName) 
 CITY ID(P) NAme
 1 A   
 2 B
 3 C
 The UserDistrict Table is having UserID(foreignkey) and CityID(foreignkey)
 RecordID(P) UserID(Foreign) CITY_ID(ForeignKey)
 1 1 1
 2 1 2
 3 1 3
Now I am saving these records and I have Checkboxlist for showing the cities on edit how i show the checkbox checked based on UserDistrict Table , I am asking how i am reading multiple rows and make the check box checked .