从数据表插入数据表
我想在某些条件下将数据从一个数据表插入到另一个数据表中。我发现此链接很有用:http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/7a5d0f88-3e71-435a-ae3c-ff01d1ca22a2/ 但我无法放置.ToList()
用于我的查询。我收到以下错误:
'System.Data.EnumerableRowCollection
有人可以帮我解决这个问题吗?
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()
I want to insert data from one DataTable to another with some conditions. I have found this link useful: http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/7a5d0f88-3e71-435a-ae3c-ff01d1ca22a2/ but I'm not able to put .ToList()
for my query. I'm getting the below error:
'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?)
Could some please help me to resolve this?
PS: My query:
(from crow in dtConfiguration.AsEnumerable()
where crow.Field<string>("FieldType") == "FL"
& crow.Field<string>("FieldName") != "DATEADDED"
& crow.Field<string>("FieldName") != "DATEMODIFIED"
select crow).ToList()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将以下语句添加到您的代码中:
Add the following statement to your code:
我认为您需要对 System.Data.DataSetExtensions 的引用,通常可以在以下位置找到
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.DataSetExtensions.dll
I think you would need a reference to System.Data.DataSetExtensions commenly found at
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Data.DataSetExtensions.dll