在Linq Copy to Datatable中选择新查询 [英] Select new query in Linq Copy to Datatable
本文介绍了在Linq Copy to Datatable中选择新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有linq查询,它选择了新类型。这就是我无法复制到数据表的原因。它只转换为如下所示的列表;
I have linq query which has select new type. That's why i can't copy to datatable. It only converts to list like below;
如何复制以选择新的查询到数据表?我只能使用ToList,但List不符合我需要的要求。
How can i copy to select new query to data table? I only can use ToList but List doesn't meet requirements that i need.
推荐答案
你可以将列表转换为dataTable并使用数据表。
You can convert the list into dataTable and use the datatable .
https://stackoverflow.com/questions/18100783/how-to-convert-a-list-into-data-table
https://stackoverflow.com/questions/564366 / convert-generic-list-enumerable-to-datatable
这篇关于在Linq Copy to Datatable中选择新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文