IAbstractConnection

Overview

Data Abstract allows uniform use of connections established using different ADO.NET providers through the use of the IAbstractConnection interface.

You acquire an abstract connection interface through the use of the ConnectionManager.AcquireConnection method. When you are done using it, release it using the ConnectionManager.ReleaseConnection method.

The methods and properties of IAbstractConnection allow you to work with transactions, create new data readers, execute commands and do several useful operations. Refer to each individual property and method for more information about the functionality offered by this interface.

The BaseConnection class provides one implementation of this interface used by Data Abstract's drivers.

Location


 

BeginTransaction

 

method BeginTransaction: Int32

 

Int32 BeginTransaction()

 

Function BeginTransaction() As Int32

BeginTransaction (IsolationLevel): Int32

Starts a new transaction on the database server that will be used for all subsequent modifications. The transaction will remain open until either CommitTransaction is called to commit the changes to the database or RollBackTransaction is called to abandon the changes. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method BeginTransaction(isolationLevel: IsolationLevel): Int32

 

Int32 BeginTransaction(IsolationLevel isolationLevel)

 

Function BeginTransaction(isolationLevel As IsolationLevel) As Int32

Parameters:

  • isolationLevel:

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

Commits a transaction that was started with a previous call to BeginTransaction and persists the changes to the database. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method CommitTransaction

 

void CommitTransaction()

 

Sub CommitTransaction()

Connected

Indicates if the connection is currently open and connected to a database.

 

property Connected: Boolean read write;

 

Boolean Connected { get; set; }

 

Property Connected() As Boolean

ConnectionString

Returns the Data Abstract connection string used by the connection.

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

Property ConnectionString() As String

CurrentTransaction

Returns a reference to the current transaction object. IAbstractConnection provides three useful methods to work with transactions: BeginTransaction, CommitTransaction and RollbackTransaction. While a transaction object is still created internally, Data Abstract for .NET doesn't force you to keep a separate reference to it. This property allows you to access the transaction object the connection holds internally.

 

property CurrentTransaction: IDbTransaction read;

 

IDbTransaction CurrentTransaction { get; }

 

ReadOnly Property CurrentTransaction() As IDbTransaction

DatabaseProfile

A reference to the DatabaseProfile object to which connection refers.

 

property DatabaseProfile: DatabaseProfile read;

 

DatabaseProfile DatabaseProfile { get; }

 

ReadOnly Property DatabaseProfile() As DatabaseProfile

DataProviderInfo

A reference to the DataProviderInfo this connection references.

 

property DataProviderInfo: DataProviderInfo read;

 

DataProviderInfo DataProviderInfo { get; }

 

ReadOnly Property DataProviderInfo() As DataProviderInfo

DataProviderParams

CaseInsensitiveNameValueCollection || Contains a list of driver-specific parameters for this connection. Depending on the used driver, these parameters can be used to specify additional information such as the database sub-type, SQL language dialect or network protocol.

 

property DataProviderParams: IDictionary<String, String> read;

 

IDictionary<String, String> DataProviderParams { get; }

 

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

DriverName

Contains the name of the driver that makes this connection to the underlying database.

 

property DriverName: String read;

 

String DriverName { get; }

 

ReadOnly Property DriverName() As String

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:

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>

GetStoredProcedureNames

 

method GetStoredProcedureNames: List<String>

 

List<String> GetStoredProcedureNames()

 

Function GetStoredProcedureNames() As List<String>

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

Returns whether the connection is currently within the contact of a transaction or not.

 

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

Returns the name of the connection, as specified in the .daConnection file.

 

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)

Opens the connection by establishing a physical connection to the database server.

 

method Open(userId: String; password: String)

 

void Open(String userId, String password)

 

Sub Open(userId As String, password As String)

Parameters:

  • userId:
  • password:

Password

Indicates the Password that is used to connect to the database. If the database in question uses authentication, UserID and Password will need to match a login set up on your database server.

 

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

Rolls back a transaction that was started with a previous call to BeginTransaction and abandons the changes without applying them to the database. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method RollbackTransaction

 

void RollbackTransaction()

 

Sub RollbackTransaction()

SetParameterValue

Sets the value of the provided command parameter.

 

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

Indicates the UserID or Login Name that is used to connect to the database. If the database in question uses authentication, UserID and Password will need to match a login set up on your database server.

 

property UserID: String read write;

 

String UserID { get; set; }

 

Property UserID() As String

 

CommandTimeout

 

property CommandTimeout: Int32 read write;

 

Int32 CommandTimeout { get; set; }

 

Property CommandTimeout() As Int32

Connected

Indicates if the connection is currently open and connected to a database.

 

property Connected: Boolean read write;

 

Boolean Connected { get; set; }

 

Property Connected() As Boolean

ConnectionString

Returns the Data Abstract connection string used by the connection.

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

Property ConnectionString() As String

CurrentTransaction

Returns a reference to the current transaction object. IAbstractConnection provides three useful methods to work with transactions: BeginTransaction, CommitTransaction and RollbackTransaction. While a transaction object is still created internally, Data Abstract for .NET doesn't force you to keep a separate reference to it. This property allows you to access the transaction object the connection holds internally.

 

property CurrentTransaction: IDbTransaction read;

 

IDbTransaction CurrentTransaction { get; }

 

ReadOnly Property CurrentTransaction() As IDbTransaction

DatabaseProfile

A reference to the DatabaseProfile object to which connection refers.

 

property DatabaseProfile: DatabaseProfile read;

 

DatabaseProfile DatabaseProfile { get; }

 

ReadOnly Property DatabaseProfile() As DatabaseProfile

DataProviderInfo

A reference to the DataProviderInfo this connection references.

 

property DataProviderInfo: DataProviderInfo read;

 

DataProviderInfo DataProviderInfo { get; }

 

ReadOnly Property DataProviderInfo() As DataProviderInfo

DataProviderParams

CaseInsensitiveNameValueCollection || Contains a list of driver-specific parameters for this connection. Depending on the used driver, these parameters can be used to specify additional information such as the database sub-type, SQL language dialect or network protocol.

 

property DataProviderParams: IDictionary<String, String> read;

 

IDictionary<String, String> DataProviderParams { get; }

 

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

DriverName

Contains the name of the driver that makes this connection to the underlying database.

 

property DriverName: String read;

 

String DriverName { get; }

 

ReadOnly Property DriverName() As String

InTransaction

Returns whether the connection is currently within the contact of a transaction or not.

 

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

Returns the name of the connection, as specified in the .daConnection file.

 

property Name: String read;

 

String Name { get; }

 

ReadOnly Property Name() As String

Password

Indicates the Password that is used to connect to the database. If the database in question uses authentication, UserID and Password will need to match a login set up on your database server.

 

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

Indicates the UserID or Login Name that is used to connect to the database. If the database in question uses authentication, UserID and Password will need to match a login set up on your database server.

 

property UserID: String read write;

 

String UserID { get; set; }

 

Property UserID() As String

 

BeginTransaction

 

method BeginTransaction: Int32

 

Int32 BeginTransaction()

 

Function BeginTransaction() As Int32

BeginTransaction (IsolationLevel): Int32

Starts a new transaction on the database server that will be used for all subsequent modifications. The transaction will remain open until either CommitTransaction is called to commit the changes to the database or RollBackTransaction is called to abandon the changes. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method BeginTransaction(isolationLevel: IsolationLevel): Int32

 

Int32 BeginTransaction(IsolationLevel isolationLevel)

 

Function BeginTransaction(isolationLevel As IsolationLevel) As Int32

Parameters:

  • isolationLevel:

Close

Closes connection to the underlying database.

 

method Close

 

void Close()

 

Sub Close()

CommitTransaction

Commits a transaction that was started with a previous call to BeginTransaction and persists the changes to the database. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method CommitTransaction

 

void CommitTransaction()

 

Sub CommitTransaction()

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:

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>

GetStoredProcedureNames

 

method GetStoredProcedureNames: List<String>

 

List<String> GetStoredProcedureNames()

 

Function GetStoredProcedureNames() As List<String>

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)

Opens the connection by establishing a physical connection to the database server.

 

method Open(userId: String; password: String)

 

void Open(String userId, String password)

 

Sub Open(userId As String, password As String)

Parameters:

  • userId:
  • password:

RearrangeCommandParameters

 

method RearrangeCommandParameters(command: IDbCommand)

 

void RearrangeCommandParameters(IDbCommand command)

 

Sub RearrangeCommandParameters(command As IDbCommand)

Parameters:

  • command:

RollbackTransaction

Rolls back a transaction that was started with a previous call to BeginTransaction and abandons the changes without applying them to the database. Note: If you are using a DataAbstractService to implement your middle tier server, transactions will be started and committed/rolled back for you automatically.

 

method RollbackTransaction

 

void RollbackTransaction()

 

Sub RollbackTransaction()

SetParameterValue

Sets the value of the provided command parameter.

 

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: