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-", ""));
 }
        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 ex)
            {


            }


        }
Exemplo n.º 3
0
        public void bindCity()
        {
            my.general objGen = new my.general();
            try
            {
                DataSet ds = objGen.getdataset("select distinct regionCounty from inmemorialcardtdl where country = '" + DropDownList1.SelectedValue + "' and isnull(regionCounty,'') <> ''  order by regionCounty");
                drlistRegionCounty.DataSource = ds.Tables[0];
                drlistRegionCounty.DataBind();
                drlistRegionCounty.DataTextField = "regionCounty";
                drlistRegionCounty.DataValueField = "regionCounty";
                drlistRegionCounty.DataBind();
                drlistRegionCounty.Items.Insert(0, new ListItem("--Region/County--", ""));
            }
            catch (Exception ex)
            {


            }


        }