Class DbSource<TOutput>

A database source defines either a table or sql query that returns data from a database. Multiple database are supported. Use the corresponding connection manager that fits to your database.

Inheritance
System.Object
DbSource<TOutput>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.DataFlow.Connectors
Assembly: ETLBox.dll
Syntax
    public class DbSource<TOutput> : DataFlowExecutableSource<TOutput>, ILoggableTask, IDataFlowLogging, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowSource, IDataFlowComponent, IDataFlowExecutableSource
Type Parameters
NameDescription
TOutput

Type of outgoing data.

Examples
SqlConnectionManager connMan = new SqlConnectionManager("Data Source=localhost");
DbSource<MyRow> source = new DbSource<MyRow>(connMan, "dbo.table");

Constructors

DbSource()

Declaration
    public DbSource()

DbSource(IConnectionManager)

Declaration
    public DbSource(IConnectionManager connectionManager)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

Sets the ConnectionManager

DbSource(IConnectionManager, String)

Declaration
    public DbSource(IConnectionManager connectionManager, string tableName)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

Sets the ConnectionManager

System.StringtableName

Sets the TableName

DbSource(String)

Declaration
    public DbSource(string tableName)
Parameters
TypeNameDescription
System.StringtableName

Sets the TableName

Properties

ColumnConverters

Use a column converter to apply custom conversion function to the data of a column.

Declaration
    public ICollection<ColumnConverter> ColumnConverters { get; set; }
Property Value
TypeDescription
System.Collections.Generic.ICollection<ColumnConverter>

ColumnMapping

Column mapping to map column names to properties. E.g. if the value of column "Key" should be written into the property "Id", then you can simply add a column mapping: DbColumnName: "Key" -> PropertyName: "Id".

Declaration
    public ICollection<ColumnMap> ColumnMapping { get; set; }
Property Value
TypeDescription
System.Collections.Generic.ICollection<ColumnMap>

ConnectionManager

The connection manager used to connect to the database - use the right connection manager for your database type.

Declaration
    public virtual IConnectionManager ConnectionManager { get; set; }
Property Value
TypeDescription
IConnectionManager

SourceTableDefinition

Pass a table definition that describe the source data. Only the column name needs to be provided - you can leave out other information. If you provide the TableName, ETLBox will try to read the table definition directly from the database. If you provide your own TableDefinition, this will always be used. If you provide a Sql statement, ETLBox will try to automatically read the column names from the sql query. Sometimes the automatic parsing from the query doesn't work. Then you can provide a TableDefinition which contains the column names in the same order as they appear in the sql statement.

Declaration
    public TableDefinition SourceTableDefinition { get; set; }
Property Value
TypeDescription
TableDefinition

Sql

A custom sql query to extract the data from the source.

Declaration
    public string Sql { get; set; }
Property Value
TypeDescription
System.String

TableName

The name of the database table to read data from.

Declaration
    public string TableName { get; set; }
Property Value
TypeDescription
System.String

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
System.String
Overrides

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
System.Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

InitParameter()

Declaration
    protected override void InitParameter()
Overrides

OnExecutionDoAsyncWork()

Declaration
    protected override void OnExecutionDoAsyncWork()
Overrides
ETLBox.DataFlow.DataFlowExecutableSource<TOutput>.OnExecutionDoAsyncWork()

OnExecutionDoSynchronousWork()

Declaration
    protected override void OnExecutionDoSynchronousWork()
Overrides
ETLBox.DataFlow.DataFlowExecutableSource<TOutput>.OnExecutionDoSynchronousWork()

PrepareParameter()

Declaration
    protected override void PrepareParameter()
Overrides

Implements