Class SlimDataTable
- Namespace
- TimeCockpit.Data.Database
- Assembly
- TimeCockpit.Data.dll
efficient replacement for DataTable.
public class SlimDataTable
- Inheritance
-
ObjectSlimDataTable
- 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
ordinalsDictionary<String, Int32>The ordinals of the table.
rowsObject[][]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
columnNameStringThe 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
indexInt32The 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
rowInt32The index of the row.
ordinalInt32The 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
rowInt32the index of the row.
ordinalInt32the ordinal of the column.
Returns
- T
Returns the value.
Type Parameters
TThe type of the value.