TableData

Class TableData

Defines a list of rows that can be inserted into a table

Inheritance
TableData
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
    public class TableData : ITableData, IDataReader, IDataRecord, IDisposable

Constructors

TableData(TableDefinition)

Declaration
    public TableData(TableDefinition definition)
Parameters
TypeNameDescription
TableDefinitiondefinition

TableData(TableDefinition, int)

Declaration
    public TableData(TableDefinition definition, int estimatedBatchSize)
Parameters
TypeNameDescription
TableDefinitiondefinition
intestimatedBatchSize

Properties

AllowIdentityInsert

If set to true, the connection manager will try to enable identity inserts for the corresponding table (not supported by every database)

Declaration
    public bool AllowIdentityInsert { get; set; }
Property Value
TypeDescription
bool

ColumnConverters

Declaration
    public Dictionary<string, Func<object, object>> ColumnConverters { get; set; }
Property Value
TypeDescription
Dictionary<string, Func<object, object>>

ColumnMapping

The column mapping

Declaration
    public IColumnMappingCollection ColumnMapping { get; }
Property Value
TypeDescription
IColumnMappingCollection

CurrentRow

The row that is currently processed when accessing the data reader

Declaration
    public object[] CurrentRow { get; }
Property Value
TypeDescription
object[]

DataIndexForColumn

Resolves the index number for a column name

Declaration
    public Dictionary<string, int> DataIndexForColumn { get; set; }
Property Value
TypeDescription
Dictionary<string, int>

Definition

Definition of the destination table

Declaration
    public TableDefinition Definition { get; }
Property Value
TypeDescription
TableDefinition

Depth

Declaration
    public int Depth { get; }
Property Value
TypeDescription
int

DestinationTableName

The name of the destination table

Declaration
    public string DestinationTableName { get; }
Property Value
TypeDescription
string

FieldCount

Declaration
    public int FieldCount { get; }
Property Value
TypeDescription
int

IsClosed

Declaration
    public bool IsClosed { get; }
Property Value
TypeDescription
bool

this[int]

Declaration
    public object this[int i] { get; }
Parameters
TypeNameDescription
inti
Property Value
TypeDescription
object

this[string]

Declaration
    public object this[string name] { get; }
Parameters
TypeNameDescription
stringname
Property Value
TypeDescription
object

KeepIdentity

By default, identity columns are included. If set to false, identity columns will be ignored

Declaration
    public bool KeepIdentity { get; set; }
Property Value
TypeDescription
bool

ReadIndex

The row index of the current row

Declaration
    public int ReadIndex { get; }
Property Value
TypeDescription
int

RecordsAffected

Declaration
    public int RecordsAffected { get; }
Property Value
TypeDescription
int

Rows

Rows/Columns ready for bulk insert

Declaration
    public List<object[]> Rows { get; set; }
Property Value
TypeDescription
List<object[]>

ValueGeneratedColumnData

A sorted list which contains data for each value generated column (the order in the object array is the same as defined in ValueGeneratedColumnNames). The key of the list is a unique sequence number, and the order matches also to each entry in the Rows.

Declaration
    public SortedList<int, object[]> ValueGeneratedColumnData { get; set; }
Property Value
TypeDescription
SortedList<int, object[]>

ValueGeneratedColumnNames

A collection of all column names that are value generated columns (e.g. columns with a COMPUTED or DEFAULT value)

Declaration
    public ICollection<string> ValueGeneratedColumnNames { get; set; }
Property Value
TypeDescription
ICollection<string>

Methods

AddSequenceColumn(string)

Allows to name a column that is specifically used as a sequence column. The column will then be treated differently.

Declaration
    public void AddSequenceColumn(string sequenceColumnName)
Parameters
TypeNameDescription
stringsequenceColumnName

Close()

Declaration
    public void Close()

Dispose()

Declaration
    public void Dispose()

Dispose(bool)

Declaration
    protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
booldisposing

GetBoolean(int)

Declaration
    public bool GetBoolean(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
bool

GetByte(int)

Declaration
    public byte GetByte(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
byte

GetBytes(int, long, byte[], int, int)

Declaration
    public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Parameters
TypeNameDescription
inti
longfieldOffset
byte[]buffer
intbufferoffset
intlength
Returns
TypeDescription
long

GetChar(int)

Declaration
    public char GetChar(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
char

GetChars(int, long, char[], int, int)

Declaration
    public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Parameters
TypeNameDescription
inti
longfieldoffset
char[]buffer
intbufferoffset
intlength
Returns
TypeDescription
long

GetData(int)

Declaration
    public IDataReader GetData(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
IDataReader

GetDataTypeName(int)

Declaration
    public string GetDataTypeName(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
string

GetDataTypeName(string)

Resolves the data type name for a column

Declaration
    public string GetDataTypeName(string columnName)
Parameters
TypeNameDescription
stringcolumnName

Column name

Returns
TypeDescription
string

Data type name

GetDateTime(int)

Declaration
    public DateTime GetDateTime(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
DateTime

GetDecimal(int)

Declaration
    public decimal GetDecimal(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
decimal

GetDouble(int)

Declaration
    public double GetDouble(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
double

GetFieldType(int)

Declaration
    public Type GetFieldType(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
Type

GetFloat(int)

Declaration
    public float GetFloat(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
float

GetGuid(int)

Declaration
    public Guid GetGuid(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
Guid

GetInt16(int)

Declaration
    public short GetInt16(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
short

GetInt32(int)

Declaration
    public int GetInt32(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
int

GetInt64(int)

Declaration
    public long GetInt64(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
long

GetName(int)

Declaration
    public string GetName(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
string

GetOrdinal(string)

Declaration
    public int GetOrdinal(string name)
Parameters
TypeNameDescription
stringname
Returns
TypeDescription
int

GetSchemaTable()

Declaration
    public DataTable GetSchemaTable()
Returns
TypeDescription
DataTable

GetString(int)

Declaration
    public string GetString(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
string

GetTableColumn(string)

Resolves the column in the table definition

Declaration
    public TableColumn GetTableColumn(string columnName)
Parameters
TypeNameDescription
stringcolumnName

Column name

Returns
TypeDescription
TableColumn

GetValue(int)

Declaration
    public object GetValue(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
object

GetValues(object[])

Declaration
    public int GetValues(object[] values)
Parameters
TypeNameDescription
object[]values
Returns
TypeDescription
int

IsDBNull(int)

Declaration
    public bool IsDBNull(int i)
Parameters
TypeNameDescription
inti
Returns
TypeDescription
bool

NextResult()

Declaration
    public bool NextResult()
Returns
TypeDescription
bool

Read()

Declaration
    public bool Read()
Returns
TypeDescription
bool

RewindReadIndex()

The IDataReader is iterated via the Read() method - once the last record was read, the Read() will return false. If you want to iterate again, you can use this method to "rewind" and start with the first record again.

Declaration
    public void RewindReadIndex()

Implements