Mark Tabor

Mark Tabor

  • 569
  • 1.9k
  • 430.8k

How to get country name instead of its ID

Apr 24 2019 12:53 AM
I have a peroperty Table and in which i am saving the city and country id , although i have city and country separate table as well and it is having the id and name and my property table is having city and country id as foriegn key , although i new i need to join the table and then get the name but my property class is having properties of column as integer type so it gives error when i am assigning the name instead of id as shown below 
p.Property_City = rdr["Property_City"].ToString();
 
it ask me to convert this to int , because my property class has property_City as type int  

Answers (4)