Table of Contents

Class SlimDataTable

Namespace
TimeCockpit.Data.Database
Assembly
TimeCockpit.Data.dll

efficient replacement for DataTable.

public class SlimDataTable
Inheritance
Object
SlimDataTable
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Constructors

SlimDataTable(Dictionary<String, Int32>, Object[][])

Initializes a new instance of the SlimDataTable class.

public SlimDataTable(Dictionary<string, int> ordinals, object[][] rows)

Parameters

ordinals Dictionary<String, Int32>

The ordinals of the table.

rows Object[][]

The rows of the table.

Properties

MaxOrdinal

Gets the number of columns.

public int MaxOrdinal { get; }

Property Value

Int32

Ordinals

Gets the ordinals, readonly.

public IEnumerable<KeyValuePair<string, int>> Ordinals { get; }

Property Value

IEnumerable<KeyValuePair<String, Int32>>

RowCount

Gets the row count of the table.

public int RowCount { get; }

Property Value

Int32

Rows

Gets the rows.

public IEnumerable<object[]> Rows { get; }

Property Value

IEnumerable<Object[]>

Methods

GetOrdinal(String)

Gets the ordinal of a specific column name.

public int GetOrdinal(string columnName)

Parameters

columnName String

The name of the column.

Returns

Int32

Returns the ordinal of the column.

GetRow(Int32)

Gets the row at specified index.

public object[] GetRow(int index)

Parameters

index Int32

The index of the row.

Returns

Object[]

Returns the row at given index.

GetValue(Int32, Int32)

Gets the value of the table.

public object GetValue(int row, int ordinal)

Parameters

row Int32

The index of the row.

ordinal Int32

The column index / ordinal.

Returns

Object

Returns the object at the given location.

GetValue<T>(Int32, Int32)

Gets the value at the specified location.

public T GetValue<T>(int row, int ordinal)

Parameters

row Int32

the index of the row.

ordinal Int32

the ordinal of the column.

Returns

T

Returns the value.

Type Parameters

T

The type of the value.