当前位置: 代码迷 >> ASP.NET >> DropDownList绑定值的有关问题
  详细解决方案

DropDownList绑定值的有关问题

热度:8358   发布时间:2013-02-25 00:00:00.0
DropDownList绑定值的问题
ILineClass ilcsll = (ContainerWebAccessorUtil.ObtainContainer())["LineClassService"] as ILineClass;
  Model.LineClass lclsd = ilcsll.Find1(Convert.ToInt32(weiboNick.Text));

  DropDownList1.DataSource = lclsd;

  DropDownList1.DataTextField = "name";

  DropDownList1.DataValueField = "id";

  DropDownList1.DataBind();



怎么是数据源的类型无效。它必须是 IListSource、IEnumerable 或 IDataSource错误

------解决方案--------------------------------------------------------
lclsd 把它转换成数组或者数据集合再赋值把
  相关解决方案