Exemple #1
0
        public void GetEmployeeList()
        {
            DataSet dsEmpLists = objLogin.GetAllEmpDetails();

            if (dsEmpLists.Tables[0].Rows.Count > 0)
            {
                ddlAssignedTo.DataTextField  = dsEmpLists.Tables[0].Columns["FullName"].ToString(); // text field name of table dispalyed in dropdown
                ddlAssignedTo.DataValueField = dsEmpLists.Tables[0].Columns["Empid"].ToString();    // to retrive specific  textfield name
                ddlAssignedTo.DataSource     = dsEmpLists.Tables[0];                                //assigning datasource to the dropdownlist
                ddlAssignedTo.DataBind();                                                           //binding dropdownlist

                ddlAssignedTo.Items.Insert(0, new ListItem("--Select--", "0"));
            }
        }