C# Class DataTableWriter.Adapters.DbAdapter

A simple database adapter to manage connections as well as exposing table manipulation functionality that other classes can leverage.
Inheritance: IDbAdapter
Mostra file Open project: tableau/TabMon Class Usage Examples

Public Methods

Method Description
AddColumnsToTableToMatchSchema ( string tableName, DataTable schema ) : void

Adds columns to an existing database table to include all columns present in a given schema.

CloseConnection ( ) : void

Close the database connection.

DbAdapter ( DbDriverType driverType, IDbConnectionInfo connectionInfo ) : System
Dispose ( ) : void
ExistsColumn ( string dbTableName, DataColumn column ) : bool

Indicates whether a column with a given name already exists in a database table.

IsConnectionOpen ( ) : bool

Returns true if database connection is in an open state.

OpenConnection ( ) : void

Open the database connection.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
AddColumn ( string dbTableName, DataColumn column ) : void
ClusterIndex ( string tableName, string indexName ) : void
CreateIndexOnTable ( string tableName, string columnName, string indexName ) : void
CreateTable ( DataTable schema, bool generateIdentity = true ) : void
DeleteRowsOlderThan ( string tableName, int threshold ) : void
DropIndex ( string indexName ) : void
ExistsTable ( string tableName ) : bool
GetIndexes ( string tableName ) : IList
GetSchema ( string tableName ) : DataTable
InsertRow ( string dbTableName, DataRow row ) : void

Method Details

AddColumnsToTableToMatchSchema() public method

Adds columns to an existing database table to include all columns present in a given schema.
public AddColumnsToTableToMatchSchema ( string tableName, DataTable schema ) : void
tableName string The name of the table to add columns to.
schema System.Data.DataTable The schema to use as a point of reference.
return void

CloseConnection() public method

Close the database connection.
public CloseConnection ( ) : void
return void

DbAdapter() public method

public DbAdapter ( DbDriverType driverType, IDbConnectionInfo connectionInfo ) : System
driverType DbDriverType
connectionInfo IDbConnectionInfo
return System

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

ExistsColumn() public method

Indicates whether a column with a given name already exists in a database table.
public ExistsColumn ( string dbTableName, DataColumn column ) : bool
dbTableName string The table to check for existence of the column.
column System.Data.DataColumn The column to check for a match.
return bool

IsConnectionOpen() public method

Returns true if database connection is in an open state.
public IsConnectionOpen ( ) : bool
return bool

OpenConnection() public method

Open the database connection.
public OpenConnection ( ) : void
return void