public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {
nsBll.CouBll pBAL = new nsBll.CouBll(); List<nsBo.clscouprp> dataSource = pBAL.disp_rec(); lstcountry.DataSource = dataSource; lstcountry.DataTextField = "p_counam"; lstcountry.DataValueField = "p_coucod"; lstcountry.DataBind();
}
protected void lstcountry_SelectedIndexChanged(object sender, EventArgs e) { string qry = "select * from tbl_office where countrycode = '" + lstcountry.SelectedValue + "'"; SqlDataAdapter da = new SqlDataAdapter(qry, ConfigurationManager.ConnectionStrings["cn"].ConnectionString); DataSet ds = new DataSet(); da.Fill(ds); grdlocation.DataSource = ds; grdlocation.DataBind(); } }