第一种:

List<ItemType> LsItemType = DBFactory.CreateDA().List<ItemType>();

        if (LsItemType.Count > 0)
        {
            foreach (ItemType TypeItem in LsItemType)
            {
                DropDownListItemType.Items.Add(TypeItem.Name);
            }
        }

 

第二种:

 

List<ItemType> LsItemType = DBFactory.CreateDA().List<ItemType>();

        DropDownListItemType.DataSource = LsItemType;
        DropDownListItemType.DataTextField = "Name";
        DropDownListItemType.DataValueField = "Name";
        DropDownListItemType.DataBind();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-07-11
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
猜你喜欢
  • 2021-06-11
  • 2022-12-23
  • 2021-08-27
  • 2021-07-19
  • 2021-08-27
  • 2022-02-23
相关资源
相似解决方案