Creates a DataTable from an IEnumerable of object[] with the specified columns.
public static DataTable ToDataTable(this IEnumerable<object[]> src, DataColumn[] cols,
string name = "Default")| parameter | description |
|---|---|
| src | Source collection |
| cols | Headers to use for the DataTable |
| name | DataTable name (optional) |
- class EnumerableExtensions
- namespace Wokhan.Collections.Generic.Extensions
Creates a DataTable from an IEnumerable, optionnally overriding the column headers.
public static DataTable ToDataTable<T>(this IEnumerable<T> src, IList<string> headers = null,
string name = "Default")| parameter | description |
|---|---|
| T | Items type |
| src | Source collection |
| headers | Headers to use for the DataTable |
| name | DataTable name (optional) |
- class EnumerableExtensions
- namespace Wokhan.Collections.Generic.Extensions