Is it possible to convert IEnumerable
to DataSet
?
I have this repeater that I suspect needs to be a DataSet for it to find the Eval column of the table. Here is my code:
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();
I get the following exception:
"Additional information: DataBinding: '<>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]]' does not contain a property with the name 'FirstName'."