Example #1
0
        public void bindCity()
        {
            try
            {
                my.general objGen = new my.general();
                DataSet ds = objGen.getdataset("select isnull(county_region,'') as county from tbl_countryRegionCity where country = '" + DropDownList1.SelectedValue + "' and isnull(county_region,'') <> ''  order by county_region");
                drlistRegionCounty.DataSource = ds.Tables[0];
                drlistRegionCounty.DataBind();
                drlistRegionCounty.DataTextField = "county";
                drlistRegionCounty.DataValueField = "county";
                drlistRegionCounty.DataBind();
                drlistRegionCounty.Items.Insert(0, new ListItem("--Region/County--", ""));
            }
            catch (Exception)
            {
                
               
            }
         

        }
Example #2
0
 public void bindContry()
 {
     my.general objGen = new my.general();
     DataSet ds = objGen.getdataset("select distinct country from tbl_countryRegionCity order by country");
     DropDownList1.DataSource = ds.Tables[0];
     DropDownList1.DataBind();
     DropDownList1.DataTextField = "country";
     DropDownList1.DataValueField = "country";
     DropDownList1.DataBind();
     DropDownList1.Items.Insert(0, new ListItem("--Country--", ""));
 }