是否可以将IEnumerable
转换为DataSet
?
我有这个转发器,我怀疑它需要是一个DataSet才能找到表的Eval列。这是我的代码:
C#:
var node = _administrationSystem.GetNodes(); //DataSet
var operatorInfo = _administrationSystem.GetOperatorsInformation(userId); //DataSet
var result = from nodes in node.Tables[0].AsEnumerable().ToList()
join operators in operatorInfo.Tables[0].AsEnumerable().ToList()
on nodes.Field<int>("NodeIndex") equals operators.Field<int>("NodeIndex")
select new {nodes, operators}; //IEnumerable
rptList.DataSource = result; //The repeater. I get exception in ASPX that cannot find proper data.
rptList.DataBind();
我得到以下异常:
&#34;其他信息:DataBinding:&#39;&lt;&gt; f__AnonymousType0`2 [[System.Data.DataRow,System.Data,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089], [System.Data.DataRow,System.Data,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]]&#39;不包含名称为&#39; FirstName&#39;。&#34;
的媒体资源