public List <Country> GetCountry() { ValueController ob1 = new ValueController(); DataSet ds = ob1.GetCountry(); List <Country> coutrylist = new List <Country>(); foreach (DataRow dr in ds.Tables[0].Rows) { coutrylist.Add(new Country { CountryName = dr["CountryName"].ToString(), CountryId = Convert.ToInt32(dr["CountryId"]) }); } return(coutrylist); }