private void frmCityNew_Load(object sender, EventArgs e)
 {
     DAL.Country country = new DAL.Country();
     cmbCountry.Source(country.Select());
     this.MinimumSize = Size;
     this.MaximumSize = Size;
 }
        private void frmStudentNew_Load(object sender, EventArgs e)
        {
            DAL.Country country = new DAL.Country();
            cmbCountry.DataSource = country.Select("Where id in (Select countryId from city)").Tables[0];

            cmbCountry.DisplayMember = "name";
            cmbCountry.ValueMember   = "Id";
            cmbCountry.SelectedValue = -1;

            DAL.Department department = new DAL.Department();
            cmbDepartment.DataSource = department.Select("Where id in (Select departmentId from program)").Tables[0];

            cmbDepartment.DisplayMember = "name";
            cmbDepartment.ValueMember   = "Id";
            cmbDepartment.SelectedValue = -1;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }

            DAL.Country cnt = new DAL.Country();

            DropDownList ddl = (DropDownList)DetailsView1.FindControl("ddlCountry");

            ddl.AppendDataBoundItems = true;
            ddl.Items.Add(new ListItem("Select", "0"));

            ddl.DataSource     = cnt.Select().Tables[0];
            ddl.DataTextField  = "name";
            ddl.DataValueField = "id";
            ddl.DataBind();
        }
Ejemplo n.º 4
0
 private void frmCityNew_Load(object sender, EventArgs e)
 {
     DAL.Country country = new DAL.Country();
     cmbCountry.Source(country.Select());
 }