Wraps a typed ADO.NET data table in an IndexedDataTable<(Of <(<'TRow>)>)> so it can be indexed and queried using the optimized query operators from IndexedQueryExtensions.

Namespace:  C1.LiveLinq.AdoNet
Assembly:  C1.LiveLinq (in C1.LiveLinq.dll)

Syntax

C#
public static IndexedDataTable<TRow> AsIndexed<TRow>(
	this TypedTableBase<TRow> table
)
where TRow : DataRow
Visual Basic
<ExtensionAttribute> _
Public Shared Function AsIndexed(Of TRow As DataRow) ( _
	table As TypedTableBase(Of TRow) _
) As IndexedDataTable(Of TRow)

Parameters

table
Type: System.Data..::..TypedTableBase<(Of <(<'TRow>)>)>
A typed data table to represent as an IndexedDataTable<(Of <(<'TRow>)>)>.

Type Parameters

TRow
The type of the rows in the table.

Return Value

An IndexedDataTable<(Of <(<'TRow>)>)> that contains the same rows as table and enables indexing of its rows.

Remarks

Use this method to index typed data tables and query them using the query operators optimized with indexing.

Elements of the source data table aren't duplicated or copied to a new collection. This method just wraps the original data table in an IndexedDataTable<(Of <(<'TRow>)>)>.

Note: The IndexedDataTable<(Of <(<'TRow>)>)> wrapper is owned by the original DataTable object (in fact, it is stored in its ExtendedProperties). So, if you create a wrapper for the same data table several times, it will be the same object.

See Also