Use the following function
public static List<Country> GetCountries()
{
SqlConnection conn;
string constr = "Initial Catalog=" ";
conn = new SqlConnection();
conn.ConnectionString = constr; Session["Constr"].ToString();
conn.Open();
string sql = "Select distinct city from LOCATION";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
da.Fill(dt);
List<Country> items = new List<Country>();
{
(dt.Rows.Count - 1)};
foreach (DataRow dr in dt.Rows)
{
Country country = new Country();
country.Id = dr["city"].ToString();
country.Name = dr["city"].ToString();
}
return items;
}