【发布时间】:2014-08-12 11:10:46
【问题描述】:
我正在开发一个应用程序,其中我将Object 转换为IList。然后我想将其转换为BindingList
这是我正在尝试的代码
IList data = spareEntity.getall() as IList;
var listBinding = new BindingList<IList>(data);
public object getall()
{
using (var worldbankAMSentitiesNew = new WorldBankAMSEntities())
{
var q = from fullSpareInventory in worldbankAMSentitiesNew.Spare_Inventory
select new
{
fullSpareInventory.Is_Spare,
fullSpareInventory.Manufacturer,
fullSpareInventory.Product_No,
fullSpareInventory.Remarks,
fullSpareInventory.Remedy_Ticket_No,
fullSpareInventory.Serial_No,
fullSpareInventory.Spare_Type,
fullSpareInventory.Spare_Inventory_Volume.Spare_Name,
fullSpareInventory.Spare_ID,
fullSpareInventory.Assigned_Date,
fullSpareInventory.Description,
fullSpareInventory.Spare_Volume_ID
};
return q.ToList();
}
}
【问题讨论】:
-
我对 Winform 比较陌生,所以请解释我哪里错了
-
getall方法返回的元素是什么类型的? -
获取所有返回对象
-
它是什么类型的列表?
标签: c# winforms bindinglist