Class AbstractRelationalConnection
Implements
System.Data.IDbConnection
System.IDisposable
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: Mars.Core.Data.Wrapper.Relational
Assembly: Mars.Core.dll
Syntax
public abstract class AbstractRelationalConnection : IDbConnection, IDisposable
Properties
| Improve this Doc View SourceConnectionString
Gets or sets the string used to open a database.
Declaration
public string ConnectionString { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string containing connection settings. |
ConnectionTimeout
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an
error.
Declaration
public int ConnectionTimeout { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The time (in seconds) to wait for a connection to open. The default value is 15 seconds. |
Database
Gets the name of the current database or the database to be used after a connection is opened.
Declaration
public string Database { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the current database or the name of the database to be used once a connection is open. The default value is an empty string. |
State
Gets the current state of the connection.
Declaration
public ConnectionState State { get; }
Property Value
Type | Description |
---|---|
System.Data.ConnectionState | One of the System.Data.ConnectionState values. |
Methods
| Improve this Doc View SourceBeginTransaction()
Begins a database transaction.
Declaration
public IDbTransaction BeginTransaction()
Returns
Type | Description |
---|---|
System.Data.IDbTransaction | An object representing the new transaction. |
BeginTransaction(IsolationLevel)
Begins a database transaction with the specified System.Data.IsolationLevel value.
Declaration
public IDbTransaction BeginTransaction(IsolationLevel il)
Parameters
Type | Name | Description |
---|---|---|
System.Data.IsolationLevel | il | One of the System.Data.IsolationLevel values. |
Returns
Type | Description |
---|---|
System.Data.IDbTransaction | An object representing the new transaction. |
ChangeDatabase(String)
Changes the current database for an open Connection object.
Declaration
public void ChangeDatabase(string databaseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | databaseName | The name of the database to use in place of the current database. |
Close()
Closes the connection to the database.
Declaration
public void Close()
CreateCommand()
Creates and returns a Command object associated with the connection.
Declaration
public IDbCommand CreateCommand()
Returns
Type | Description |
---|---|
System.Data.IDbCommand | A Command object associated with the connection. |
CreateConnection()
Creates the database-specific connection
Declaration
protected abstract IDbConnection CreateConnection()
Returns
Type | Description |
---|---|
System.Data.IDbConnection |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Open()
Opens a database connection with the settings specified by the ConnectionString property of the
provider-specific Connection object.
Declaration
public void Open()
Implements
System.Data.IDbConnection
System.IDisposable