BaseConnection

Overview

The BaseConnection class implements the IAbstractConnection interface. Instances of this class are returned by the ConnectionManager component and are used by Data Abstract to access the underlying database without need to perform direct calls to the ADO.NET interfaces.

Implemented methods and properties of the IAbstractConnection interface allow to work with transactions, create new data readers, execute commands etc.

Location


 

constructor (String)

Creates a new instance of the BaseConnection class and sets its Name property.

 

constructor(name: String)

 

BaseConnection(String name)

 

Sub New(name As String)

Parameters:

  • name: Connection name

constructor (String, String)

Creates a new instance of the BaseConnection class and sets its Name and ConnectionString properties.

 

constructor(name: String; connectionString: String)

 

BaseConnection(String name, String connectionString)

 

Sub New(name As String, connectionString As String)

Parameters:

  • name: Connection name
  • connectionString: Connection String

constructor (String, String, Boolean)

Creates a new instance of the BaseConnection class and sets its Name and ConnectionString properties.

Depending on the value of the connect flag the connection being created can be immediately opened.

 

constructor(name: String; connectionString: String; connect: Boolean)

 

BaseConnection(String name, String connectionString, Boolean connect)

 

Sub New(name As String, connectionString As String, connect As Boolean)

Parameters:

  • name: Connection name
  • connectionString: Connection String
  • connect: A flag indicating whether the connection should be opened immediately

ActualConnection

 

property ActualConnection: IDbConnection read;

 

IDbConnection ActualConnection { get; }

 

ReadOnly Property ActualConnection() As IDbConnection

BeginTransaction

 

method BeginTransaction: Int32

 

Int32 BeginTransaction()

 

Function BeginTransaction() As Int32

BeginTransaction (IsolationLevel): Int32

 

method BeginTransaction(isolationLevel: IsolationLevel): Int32

 

Int32 BeginTransaction(IsolationLevel isolationLevel)

 

Function BeginTransaction(isolationLevel As IsolationLevel) As Int32

Parameters:

  • isolationLevel:

CheckConnected  protected

 

method CheckConnected(requireConnection: Boolean)

 

void CheckConnected(Boolean requireConnection)

 

Sub CheckConnected(requireConnection As Boolean)

Parameters:

  • requireConnection:

Close

Closes connection to the underlying database.

 

method Close

 

void Close()

 

Sub Close()

CommandTimeout

 

property CommandTimeout: Int32 read write;

 

Int32 CommandTimeout { get; set; }

 

Property CommandTimeout() As Int32

CommitTransaction

 

method CommitTransaction

 

void CommitTransaction()

 

Sub CommitTransaction()

Connected

 

property Connected: Boolean read write;

 

Boolean Connected { get; set; }

 

Property Connected() As Boolean

ConnectionString

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

Property ConnectionString() As String

ConnectionType

 

property ConnectionType: String read write;

 

String ConnectionType { get; set; }

 

Property ConnectionType() As String

CreateCommand  protected

 

method CreateCommand: IDbCommand

 

IDbCommand CreateCommand()

 

Function CreateCommand() As IDbCommand

CreateCommandBuilder  protected

 

method CreateCommandBuilder: Object

 

Object CreateCommandBuilder()

 

Function CreateCommandBuilder() As Object

CreateConnection  protected

 

method CreateConnection: IDbConnection

 

IDbConnection CreateConnection()

 

Function CreateConnection() As IDbConnection

CurrentTransaction

 

property CurrentTransaction: IDbTransaction read;

 

IDbTransaction CurrentTransaction { get; }

 

ReadOnly Property CurrentTransaction() As IDbTransaction

CustomMacroHandler

 

property CustomMacroHandler: SqlMacroCallback read write;

 

SqlMacroCallback CustomMacroHandler { get; set; }

 

Property CustomMacroHandler() As SqlMacroCallback

DatabaseProfile

 

property DatabaseProfile: DatabaseProfile read;

 

DatabaseProfile DatabaseProfile { get; }

 

ReadOnly Property DatabaseProfile() As DatabaseProfile

DataProviderInfo

 

property DataProviderInfo: DataProviderInfo read;

 

DataProviderInfo DataProviderInfo { get; }

 

ReadOnly Property DataProviderInfo() As DataProviderInfo

DataProviderParams

 

property DataProviderParams: IDictionary<String, String> read;

 

IDictionary<String, String> DataProviderParams { get; }

 

ReadOnly Property DataProviderParams() As IDictionary<String, String>

Dispose

 

method Dispose

 

void Dispose()

 

Sub Dispose()

DriverName

 

property DriverName: String read;

 

String DriverName { get; }

 

ReadOnly Property DriverName() As String

FetchObjectNames  protected

 

method FetchObjectNames(sql: String): List<String>

 

List<String> FetchObjectNames(String sql)

 

Function FetchObjectNames(sql As String) As List<String>

Parameters:

  • sql:

GetCommandParams

 

method GetCommandParams(commandText: String; isStoredProcedureNameProvided: Boolean): SchemaParameterCollection

 

SchemaParameterCollection GetCommandParams(String commandText, Boolean isStoredProcedureNameProvided)

 

Function GetCommandParams(commandText As String, isStoredProcedureNameProvided As Boolean) As SchemaParameterCollection

Parameters:

  • commandText:
  • isStoredProcedureNameProvided:

GetDatabaseName  protected

 

method GetDatabaseName: String

 

String GetDatabaseName()

 

Function GetDatabaseName() As String

GetDatabaseNames

 

method GetDatabaseNames: List<String>

 

List<String> GetDatabaseNames()

 

Function GetDatabaseNames() As List<String>

GetForeignKeys

 

method GetForeignKeys: SchemaRelationshipCollection

 

SchemaRelationshipCollection GetForeignKeys()

 

Function GetForeignKeys() As SchemaRelationshipCollection

GetGeneratorNames

 

method GetGeneratorNames: List<String>

 

List<String> GetGeneratorNames()

 

Function GetGeneratorNames() As List<String>

GetSQLCommandParams  protected

 

method GetSQLCommandParams(sql: String): SchemaParameterCollection

 

SchemaParameterCollection GetSQLCommandParams(String sql)

 

Function GetSQLCommandParams(sql As String) As SchemaParameterCollection

Parameters:

  • sql:

GetStoredProcedureNames

 

method GetStoredProcedureNames: List<String>

 

List<String> GetStoredProcedureNames()

 

Function GetStoredProcedureNames() As List<String>

GetStoredProcedureParams  protected

 

method GetStoredProcedureParams(procedureName: String): SchemaParameterCollection

 

SchemaParameterCollection GetStoredProcedureParams(String procedureName)

 

Function GetStoredProcedureParams(procedureName As String) As SchemaParameterCollection

Parameters:

  • procedureName:

GetTableFields

 

method GetTableFields(tableText: String; isTableNameProvided: Boolean; parameters: SchemaParameterCollection): SchemaFieldCollection

 

SchemaFieldCollection GetTableFields(String tableText, Boolean isTableNameProvided, SchemaParameterCollection parameters)

 

Function GetTableFields(tableText As String, isTableNameProvided As Boolean, parameters As SchemaParameterCollection) As SchemaFieldCollection

Parameters:

  • tableText:
  • isTableNameProvided:
  • parameters:

GetTableNames

 

method GetTableNames: List<String>

 

List<String> GetTableNames()

 

Function GetTableNames() As List<String>

GetViewNames

 

method GetViewNames: List<String>

 

List<String> GetViewNames()

 

Function GetViewNames() As List<String>

InTransaction

 

property InTransaction: Boolean read;

 

Boolean InTransaction { get; }

 

ReadOnly Property InTransaction() As Boolean

LastUsed

 

property LastUsed: DateTime read write;

 

DateTime LastUsed { get; set; }

 

Property LastUsed() As DateTime

Name

 

property Name: String read;

 

String Name { get; }

 

ReadOnly Property Name() As String

NewCommand (String, CommandType): IDbCommand

 

method NewCommand(sql: String; commandType: CommandType): IDbCommand

 

IDbCommand NewCommand(String sql, CommandType commandType)

 

Function NewCommand(sql As String, commandType As CommandType) As IDbCommand

Parameters:

  • sql:
  • commandType:

NewCommand (String, CommandType, SchemaParameterCollection, String, String): IDbCommand

 

method NewCommand(sql: String; commandType: CommandType; parameters: SchemaParameterCollection; dynamicWhere: String; orderBy: String): IDbCommand

 

IDbCommand NewCommand(String sql, CommandType commandType, SchemaParameterCollection parameters, String dynamicWhere, String orderBy)

 

Function NewCommand(sql As String, commandType As CommandType, parameters As SchemaParameterCollection, dynamicWhere As String, orderBy As String) As IDbCommand

Parameters:

  • sql:
  • commandType:
  • parameters:
  • dynamicWhere:
  • orderBy:

NewDataTable (String, array of DbParameter, String, Boolean, Boolean): DataTable

 

method NewDataTable(sql: String; parameters: array of DbParameter; tableName: String; fillData: Boolean; fillSchema: Boolean): DataTable

 

DataTable NewDataTable(String sql, DbParameter[] parameters, String tableName, Boolean fillData, Boolean fillSchema)

 

Function NewDataTable(sql As String, parameters As DbParameter(), tableName As String, fillData As Boolean, fillSchema As Boolean) As DataTable

Parameters:

  • sql:
  • parameters:
  • tableName:
  • fillData:
  • fillSchema:

NewDataTable (String, String, Boolean, Boolean): DataTable

 

method NewDataTable(sql: String; tableName: String; fillData: Boolean; fillSchema: Boolean): DataTable

 

DataTable NewDataTable(String sql, String tableName, Boolean fillData, Boolean fillSchema)

 

Function NewDataTable(sql As String, tableName As String, fillData As Boolean, fillSchema As Boolean) As DataTable

Parameters:

  • sql:
  • tableName:
  • fillData:
  • fillSchema:

Open

Opens connection to the underlying database.

 

method Open

 

void Open()

 

Sub Open()

Open (String, String)

 

method Open(userId: String; password: String)

 

void Open(String userId, String password)

 

Sub Open(userId As String, password As String)

Parameters:

  • userId:
  • password:

ParseConnectionString

 

method ParseConnectionString(connectionString: String)

 

void ParseConnectionString(String connectionString)

 

Sub ParseConnectionString(connectionString As String)

Parameters:

  • connectionString:

Password

 

property Password: String read write;

 

String Password { get; set; }

 

Property Password() As String

RearrangeCommandParameters

 

method RearrangeCommandParameters(command: IDbCommand)

 

void RearrangeCommandParameters(IDbCommand command)

 

Sub RearrangeCommandParameters(command As IDbCommand)

Parameters:

  • command:

RollbackTransaction

 

method RollbackTransaction

 

void RollbackTransaction()

 

Sub RollbackTransaction()

SetParameterValue

Sets the value of the provided command parameter.

While the IDataParameter interface allows to set the parameter value directly, this method provides additional logic needed to workaround the Mono bug related to the MS SQL parameters handling.

 

method SetParameterValue(parameter: IDataParameter; value: Object)

 

void SetParameterValue(IDataParameter parameter, Object value)

 

Sub SetParameterValue(parameter As IDataParameter, value As Object)

Parameters:

  • parameter: Command parameter
  • value: Intended parameter value

TransactionCount

 

property TransactionCount: Int32 read;

 

Int32 TransactionCount { get; }

 

ReadOnly Property TransactionCount() As Int32

TranslateParameterizedSql

 

method TranslateParameterizedSql(sql: String): String

 

String TranslateParameterizedSql(String sql)

 

Function TranslateParameterizedSql(sql As String) As String

Parameters:

  • sql:

UserID

 

property UserID: String read write;

 

String UserID { get; set; }

 

Property UserID() As String

 

ActualConnection

 

property ActualConnection: IDbConnection read;

 

IDbConnection ActualConnection { get; }

 

ReadOnly Property ActualConnection() As IDbConnection

CommandTimeout

 

property CommandTimeout: Int32 read write;

 

Int32 CommandTimeout { get; set; }

 

Property CommandTimeout() As Int32

Connected

 

property Connected: Boolean read write;

 

Boolean Connected { get; set; }

 

Property Connected() As Boolean

ConnectionString

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

Property ConnectionString() As String

ConnectionType

 

property ConnectionType: String read write;

 

String ConnectionType { get; set; }

 

Property ConnectionType() As String

CurrentTransaction

 

property CurrentTransaction: IDbTransaction read;

 

IDbTransaction CurrentTransaction { get; }

 

ReadOnly Property CurrentTransaction() As IDbTransaction

CustomMacroHandler

 

property CustomMacroHandler: SqlMacroCallback read write;

 

SqlMacroCallback CustomMacroHandler { get; set; }

 

Property CustomMacroHandler() As SqlMacroCallback

DatabaseProfile

 

property DatabaseProfile: DatabaseProfile read;

 

DatabaseProfile DatabaseProfile { get; }

 

ReadOnly Property DatabaseProfile() As DatabaseProfile

DataProviderInfo

 

property DataProviderInfo: DataProviderInfo read;

 

DataProviderInfo DataProviderInfo { get; }

 

ReadOnly Property DataProviderInfo() As DataProviderInfo

DataProviderParams

 

property DataProviderParams: IDictionary<String, String> read;

 

IDictionary<String, String> DataProviderParams { get; }

 

ReadOnly Property DataProviderParams() As IDictionary<String, String>

DriverName

 

property DriverName: String read;

 

String DriverName { get; }

 

ReadOnly Property DriverName() As String

InTransaction

 

property InTransaction: Boolean read;

 

Boolean InTransaction { get; }

 

ReadOnly Property InTransaction() As Boolean

LastUsed

 

property LastUsed: DateTime read write;

 

DateTime LastUsed { get; set; }

 

Property LastUsed() As DateTime

Name

 

property Name: String read;

 

String Name { get; }

 

ReadOnly Property Name() As String

Password

 

property Password: String read write;

 

String Password { get; set; }

 

Property Password() As String

TransactionCount

 

property TransactionCount: Int32 read;

 

Int32 TransactionCount { get; }

 

ReadOnly Property TransactionCount() As Int32

UserID

 

property UserID: String read write;

 

String UserID { get; set; }

 

Property UserID() As String

 

constructor (String)

Creates a new instance of the BaseConnection class and sets its Name property.

 

constructor(name: String)

 

BaseConnection(String name)

 

Sub New(name As String)

Parameters:

  • name: Connection name

constructor (String, String)

Creates a new instance of the BaseConnection class and sets its Name and ConnectionString properties.

 

constructor(name: String; connectionString: String)

 

BaseConnection(String name, String connectionString)

 

Sub New(name As String, connectionString As String)

Parameters:

  • name: Connection name
  • connectionString: Connection String

constructor (String, String, Boolean)

Creates a new instance of the BaseConnection class and sets its Name and ConnectionString properties.

Depending on the value of the connect flag the connection being created can be immediately opened.

 

constructor(name: String; connectionString: String; connect: Boolean)

 

BaseConnection(String name, String connectionString, Boolean connect)

 

Sub New(name As String, connectionString As String, connect As Boolean)

Parameters:

  • name: Connection name
  • connectionString: Connection String
  • connect: A flag indicating whether the connection should be opened immediately

BeginTransaction

 

method BeginTransaction: Int32

 

Int32 BeginTransaction()

 

Function BeginTransaction() As Int32

BeginTransaction (IsolationLevel): Int32

 

method BeginTransaction(isolationLevel: IsolationLevel): Int32

 

Int32 BeginTransaction(IsolationLevel isolationLevel)

 

Function BeginTransaction(isolationLevel As IsolationLevel) As Int32

Parameters:

  • isolationLevel:

CheckConnected  protected

 

method CheckConnected(requireConnection: Boolean)

 

void CheckConnected(Boolean requireConnection)

 

Sub CheckConnected(requireConnection As Boolean)

Parameters:

  • requireConnection:

Close

Closes connection to the underlying database.

 

method Close

 

void Close()

 

Sub Close()

CommitTransaction

 

method CommitTransaction

 

void CommitTransaction()

 

Sub CommitTransaction()

CreateCommand  protected

 

method CreateCommand: IDbCommand

 

IDbCommand CreateCommand()

 

Function CreateCommand() As IDbCommand

CreateCommandBuilder  protected

 

method CreateCommandBuilder: Object

 

Object CreateCommandBuilder()

 

Function CreateCommandBuilder() As Object

CreateConnection  protected

 

method CreateConnection: IDbConnection

 

IDbConnection CreateConnection()

 

Function CreateConnection() As IDbConnection

Dispose

 

method Dispose

 

void Dispose()

 

Sub Dispose()

FetchObjectNames  protected

 

method FetchObjectNames(sql: String): List<String>

 

List<String> FetchObjectNames(String sql)

 

Function FetchObjectNames(sql As String) As List<String>

Parameters:

  • sql:

GetCommandParams

 

method GetCommandParams(commandText: String; isStoredProcedureNameProvided: Boolean): SchemaParameterCollection

 

SchemaParameterCollection GetCommandParams(String commandText, Boolean isStoredProcedureNameProvided)

 

Function GetCommandParams(commandText As String, isStoredProcedureNameProvided As Boolean) As SchemaParameterCollection

Parameters:

  • commandText:
  • isStoredProcedureNameProvided:

GetDatabaseName  protected

 

method GetDatabaseName: String

 

String GetDatabaseName()

 

Function GetDatabaseName() As String

GetDatabaseNames

 

method GetDatabaseNames: List<String>

 

List<String> GetDatabaseNames()

 

Function GetDatabaseNames() As List<String>

GetForeignKeys

 

method GetForeignKeys: SchemaRelationshipCollection

 

SchemaRelationshipCollection GetForeignKeys()

 

Function GetForeignKeys() As SchemaRelationshipCollection

GetGeneratorNames

 

method GetGeneratorNames: List<String>

 

List<String> GetGeneratorNames()

 

Function GetGeneratorNames() As List<String>

GetSQLCommandParams  protected

 

method GetSQLCommandParams(sql: String): SchemaParameterCollection

 

SchemaParameterCollection GetSQLCommandParams(String sql)

 

Function GetSQLCommandParams(sql As String) As SchemaParameterCollection

Parameters:

  • sql:

GetStoredProcedureNames

 

method GetStoredProcedureNames: List<String>

 

List<String> GetStoredProcedureNames()

 

Function GetStoredProcedureNames() As List<String>

GetStoredProcedureParams  protected

 

method GetStoredProcedureParams(procedureName: String): SchemaParameterCollection

 

SchemaParameterCollection GetStoredProcedureParams(String procedureName)

 

Function GetStoredProcedureParams(procedureName As String) As SchemaParameterCollection

Parameters:

  • procedureName:

GetTableFields

 

method GetTableFields(tableText: String; isTableNameProvided: Boolean; parameters: SchemaParameterCollection): SchemaFieldCollection

 

SchemaFieldCollection GetTableFields(String tableText, Boolean isTableNameProvided, SchemaParameterCollection parameters)

 

Function GetTableFields(tableText As String, isTableNameProvided As Boolean, parameters As SchemaParameterCollection) As SchemaFieldCollection

Parameters:

  • tableText:
  • isTableNameProvided:
  • parameters:

GetTableNames

 

method GetTableNames: List<String>

 

List<String> GetTableNames()

 

Function GetTableNames() As List<String>

GetViewNames

 

method GetViewNames: List<String>

 

List<String> GetViewNames()

 

Function GetViewNames() As List<String>

NewCommand (String, CommandType): IDbCommand

 

method NewCommand(sql: String; commandType: CommandType): IDbCommand

 

IDbCommand NewCommand(String sql, CommandType commandType)

 

Function NewCommand(sql As String, commandType As CommandType) As IDbCommand

Parameters:

  • sql:
  • commandType:

NewCommand (String, CommandType, SchemaParameterCollection, String, String): IDbCommand

 

method NewCommand(sql: String; commandType: CommandType; parameters: SchemaParameterCollection; dynamicWhere: String; orderBy: String): IDbCommand

 

IDbCommand NewCommand(String sql, CommandType commandType, SchemaParameterCollection parameters, String dynamicWhere, String orderBy)

 

Function NewCommand(sql As String, commandType As CommandType, parameters As SchemaParameterCollection, dynamicWhere As String, orderBy As String) As IDbCommand

Parameters:

  • sql:
  • commandType:
  • parameters:
  • dynamicWhere:
  • orderBy:

NewDataTable (String, array of DbParameter, String, Boolean, Boolean): DataTable

 

method NewDataTable(sql: String; parameters: array of DbParameter; tableName: String; fillData: Boolean; fillSchema: Boolean): DataTable

 

DataTable NewDataTable(String sql, DbParameter[] parameters, String tableName, Boolean fillData, Boolean fillSchema)

 

Function NewDataTable(sql As String, parameters As DbParameter(), tableName As String, fillData As Boolean, fillSchema As Boolean) As DataTable

Parameters:

  • sql:
  • parameters:
  • tableName:
  • fillData:
  • fillSchema:

NewDataTable (String, String, Boolean, Boolean): DataTable

 

method NewDataTable(sql: String; tableName: String; fillData: Boolean; fillSchema: Boolean): DataTable

 

DataTable NewDataTable(String sql, String tableName, Boolean fillData, Boolean fillSchema)

 

Function NewDataTable(sql As String, tableName As String, fillData As Boolean, fillSchema As Boolean) As DataTable

Parameters:

  • sql:
  • tableName:
  • fillData:
  • fillSchema:

Open

Opens connection to the underlying database.

 

method Open

 

void Open()

 

Sub Open()

Open (String, String)

 

method Open(userId: String; password: String)

 

void Open(String userId, String password)

 

Sub Open(userId As String, password As String)

Parameters:

  • userId:
  • password:

ParseConnectionString

 

method ParseConnectionString(connectionString: String)

 

void ParseConnectionString(String connectionString)

 

Sub ParseConnectionString(connectionString As String)

Parameters:

  • connectionString:

RearrangeCommandParameters

 

method RearrangeCommandParameters(command: IDbCommand)

 

void RearrangeCommandParameters(IDbCommand command)

 

Sub RearrangeCommandParameters(command As IDbCommand)

Parameters:

  • command:

RollbackTransaction

 

method RollbackTransaction

 

void RollbackTransaction()

 

Sub RollbackTransaction()

SetParameterValue

Sets the value of the provided command parameter.

While the IDataParameter interface allows to set the parameter value directly, this method provides additional logic needed to workaround the Mono bug related to the MS SQL parameters handling.

 

method SetParameterValue(parameter: IDataParameter; value: Object)

 

void SetParameterValue(IDataParameter parameter, Object value)

 

Sub SetParameterValue(parameter As IDataParameter, value As Object)

Parameters:

  • parameter: Command parameter
  • value: Intended parameter value

TranslateParameterizedSql

 

method TranslateParameterizedSql(sql: String): String

 

String TranslateParameterizedSql(String sql)

 

Function TranslateParameterizedSql(sql As String) As String

Parameters:

  • sql: