Class DataTableExtensions
- Namespace
- AetherUtils.Core.Extensions
- Assembly
- AetherUtils.Core.dll
Provides extension methods for manipulating DataTable objects.
[UsedImplicitly]
public static class DataTableExtensions
- Inheritance
-
DataTableExtensions
- Inherited Members
Methods
ToCsvFile(DataTable, string, char)
Create and save a generated CSV file from a DataTable.
[UsedImplicitly]
public static void ToCsvFile(this DataTable table, string filePath, char delimiter = ',')
Parameters
tableDataTable- The DataTable to create a CSV file from.
filePathstring- The path of a new CSV file to create or overwrite.
delimiterchar- The delimiter to separate fields with; default is
,.
Exceptions
- ArgumentNullException
- If
tablewasnull. - ArgumentException
- If
filePathwasnullor empty.
ToCsvFiles(List<DataTable>, string, char)
Create and save individual CSV files based on a List<T> containing DataTable objects.
Each file is saved as
tablename.csv.[UsedImplicitly]
public static void ToCsvFiles(this List<DataTable> tables, string folderPath, char delimiter = ',')
Parameters
tablesList<DataTable>- The List<T> containing DataTable objects.
folderPathstring- The folder path that the CSV files should be saved into.
delimiterchar- The delimiter to separate fields with; default is
,.
Exceptions
- ArgumentNullException
- If
tableswasnull. - ArgumentException
- If
folderPathwasnullor empty.