【发布时间】:2013-12-01 04:51:06
【问题描述】:
我想从一个数据表中选择一些数据并将其复制到另一个数据表中。我在一个问题中找到了答案 - How to query a DataTable in memory to fill another data table
DataTable table = GetDataTableResults();
DataTable results = table.Select("SomeIntColumn > 0").CopyToDataTable();
此代码不起作用并导致错误 -
'System.Array' does not contain a definition for 'CopyToDataTable' and
no extension method 'CopyToDataTable' accepting a first argument of type
'System.Array' could be found (are you missing a using directive or
an assembly reference?)
我正在使用 Visual Studio 2008 和 .net 3.5。
【问题讨论】: