Aether Utilities Aether Utilities
Aether Utilities Aether Utilities
DocFX + Singulink = ♥

Search Results for

    Edit this page

    Class DataTableExtensions

    Namespace
    AetherUtils.Core.Extensions
    Assembly
    AetherUtils.Core.dll
    Provides extension methods for manipulating DataTable objects.
    [UsedImplicitly]
    public static class DataTableExtensions
    Inheritance
    object
    DataTableExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    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

    table DataTable
    The DataTable to create a CSV file from.
    filePath string
    The path of a new CSV file to create or overwrite.
    delimiter char
    The delimiter to separate fields with; default is ,.

    Exceptions

    ArgumentNullException
    If table was null.
    ArgumentException
    If filePath was null or 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

    tables List<DataTable>
    The List<T> containing DataTable objects.
    folderPath string
    The folder path that the CSV files should be saved into.
    delimiter char
    The delimiter to separate fields with; default is ,.

    Exceptions

    ArgumentNullException
    If tables was null.
    ArgumentException
    If folderPath was null or empty.
    (c) 2024 Ethan Hann. All rights reserved.