SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method ToDataTable

    ToDataTable<T, TTable>(IEnumerable<T>, TTable)

    Appends elements in the sequence as rows of a given DataTable object.

    Declaration
    public static TTable ToDataTable<T, TTable>(this IEnumerable<T> source, TTable table) where TTable : DataTable
    Parameters
    Type Name Description
    IEnumerable<T> source

    The source.

    TTable table

    A TTable to hold the data from source.

    Returns
    Type Description
    TTable

    The value passed in as table.

    Type Parameters
    Name Description
    T

    The type of the elements of source.

    TTable

    The type of the DataTable in which to store data.

    Remarks

    This operator uses immediate execution.

    Exceptions
    Type Condition
    ArgumentNullException

    source or table is null

    ToDataTable<T>(IEnumerable<T>, params Expression<Func<T, object>>[])

    Appends elements in the sequence as rows of a given DataTable object with a set of lambda expressions specifying which members (property or field) of each element in the sequence will supply the column values.

    Declaration
    public static DataTable ToDataTable<T>(this IEnumerable<T> source, params Expression<Func<T, object>>[] expressions)
    Parameters
    Type Name Description
    IEnumerable<T> source

    The source.

    Expression<Func<T, object>>[] expressions

    Expressions providing access to element members.

    Returns
    Type Description
    DataTable

    A DataTable representing the source.

    Type Parameters
    Name Description
    T

    The type of the elements of source.

    Remarks

    This operator uses immediate execution.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null

    ToDataTable<T>(IEnumerable<T>)

    Converts a sequence to a DataTable object.

    Declaration
    public static DataTable ToDataTable<T>(this IEnumerable<T> source)
    Parameters
    Type Name Description
    IEnumerable<T> source

    The source.

    Returns
    Type Description
    DataTable

    A DataTable representing the source.

    Type Parameters
    Name Description
    T

    The type of the elements of source.

    Remarks

    This operator uses immediate execution.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null

    ToDataTable<T, TTable>(IEnumerable<T>, TTable, params Expression<Func<T, object>>[])

    Appends elements in the sequence as rows of a given DataTable object with a set of lambda expressions specifying which members (property or field) of each element in the sequence will supply the column values.

    Declaration
    public static TTable ToDataTable<T, TTable>(this IEnumerable<T> source, TTable table, params Expression<Func<T, object>>[] expressions) where TTable : DataTable
    Parameters
    Type Name Description
    IEnumerable<T> source

    The source.

    TTable table

    A TTable to hold the data from source.

    Expression<Func<T, object>>[] expressions

    Expressions providing access to element members.

    Returns
    Type Description
    TTable

    The value passed in as table.

    Type Parameters
    Name Description
    T

    The type of the elements of source.

    TTable

    The type of the DataTable in which to store data.

    Remarks

    This operator uses immediate execution.

    Exceptions
    Type Condition
    ArgumentNullException

    source, table, or expressions is null

    © SuperLinq Authors. All rights reserved.