使用英语阅读

通过


DataTableExtensions 类

定义

定义 DataTable 类的扩展方法。 DataTableExtensions 是一个静态类。

public static class DataTableExtensions
继承
DataTableExtensions

方法

AsDataView(DataTable)

创建并返回支持 LINQ 的 DataView 对象。

AsDataView<T>(EnumerableRowCollection<T>)

创建并返回一个支持 DataView LINQ 的对象,该对象表示 LINQ to DataSet 查询。

AsEnumerable(DataTable)

返回一个 IEnumerable<T> 对象,其泛型参数 TDataRow。 此对象可用于 LINQ 表达式或方法查询。

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRow

适用于

产品 版本
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1