Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataAccessServiceClient cl  = new DataAccessServiceClient();
            EmployeeDataContract    edc = cl.GetEmployeeData(0);

            DropDownListSql.DataTextField  = "Name";
            DropDownListSql.DataValueField = "Id";
            DropDownListSql.DataSource     = edc.Employees.ToList();
            DropDownListSql.DataBind();
        }
Ejemplo n.º 2
0
        private void InitialiseDropDownlist(List <dynamic> temp)
        {
            #region From XML
            CountriesDropDownlist.DataSource     = (temp).ToList();
            CountriesDropDownlist.DataTextField  = "Text";
            CountriesDropDownlist.DataValueField = "Value";

            CountriesDropDownlist.DataBind();
            #endregion

            #region From SQL
            DataAccessServiceClient cl  = new DataAccessServiceClient();
            EmployeeDataContract    edc = cl.GetEmployeeData(0);

            DropDownListSql.DataTextField  = "Name";
            DropDownListSql.DataValueField = "Id";
            DropDownListSql.DataSource     = edc.Employees.ToList();
            DropDownListSql.DataBind();
            #endregion
        }