我想在某些条件下将数据从一个DataTable插入到另一个。我发现这个链接很有用:http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/7a5d0f88-3e71-435a-ae3c-ff01d1ca22a2/,但我不能将.ToList()放在我的查询中。我得到以下错误:
'System.Data.EnumerableRowCollection<System.Data.DataRow>' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Data.EnumerableRowCollection<System.Data.DataRow>' could be found (are you missing a using directive or an assembly reference?)
能帮我解决一下这个问题吗?
PS:我的问题:
(from crow in dtConfiguration.AsEnumerable()
where crow.Field<string>("FieldType") == "FL"
& crow.Field<string>("FieldName") != "DATEADDED"
& crow.Field<string>("FieldName") != "DATEMODIFIED"
select crow).ToList()发布于 2011-04-22 18:29:51
将以下语句添加到代码中:
using System.Linq;发布于 2011-08-02 02:32:10
我认为您需要一个位于C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.DataSetExtensions.dll的System.Data.DataSetExtensions引用
https://stackoverflow.com/questions/5754469
复制相似问题