我的代码:
IQueryable grpdRows;
grpdRows = dtInput
.Select("", "partno")
.AsQueryable()
.GroupBy("new (iif(it[\"partno\"] == null, \"\", it[\"partno\"]) as GrpKey1)","it")
.Select("new (it.Key.GrpKey1 as GrpKey1, it.Count() as TotalCount")");
我需要在grpdRows
中获得“arrayList
”结果视图。
答案 0 :(得分:0)
我认为这段代码可能会对您有所帮助:
IList<string> list = new List<string>
{
"Value1",
"Value2",
"Value3",
"Value4"
};
IQueryable query = list.AsQueryable();
ArrayList arrayList = new ArrayList(query.Cast<string>().ToList());
您提供的代码不足,因此我使用string
代替了我的示例。