Table of Contents

Class DataConnectionFactory

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Provides DataConnection object for specified data provider according to configuration settings.

public static class DataConnectionFactory
Inheritance
object
DataConnectionFactory

Properties

ConnectionString

Connection string of the provider object.

[Obsolete("Use ProviderObject.ConnectionString instead.")]
[ObsoleteSince(28, 2)]
public static string ConnectionString { get; set; }

Property Value

string
See Also

CurrentConnection

Current DB connection to use within current connection scope.

[Obsolete("Use ProviderObject.CurrentConnection instead.")]
[ObsoleteSince(28, 2)]
public static IDataConnection CurrentConnection { get; set; }

Property Value

IDataConnection
See Also

GeneratorObject

Returns the SQL generator object.

[Obsolete("Member is deprecated and will be removed in next version.")]
[ObsoleteSince(28, 2)]
public static ISqlGenerator GeneratorObject { get; }

Property Value

ISqlGenerator

ProviderObject

Returns the provider object.

public static IDataProvider ProviderObject { get; }

Property Value

IDataProvider

TableManagerObject

Returns the Table manager object.

public static ITableManager TableManagerObject { get; }

Property Value

ITableManager

Methods

GetConnection()

Returns a new database connection.

public static IDataConnection GetConnection()

Returns

IDataConnection

GetConnection(string)

Returns a new database connection.

public static IDataConnection GetConnection(string connectionString)

Parameters

connectionString string

Connection string

Returns

IDataConnection

GetNativeConnection(string, bool)

Returns a new database connection.

public static IDataConnection GetNativeConnection(string connectionString, bool newConnection = false)

Parameters

connectionString string

Connection string

newConnection bool

If true, a new connection instance is created

Returns

IDataConnection

NewTableManagerObject(string)

Creates a new table manager object with the given connection string

public static ITableManager NewTableManagerObject(string connectionString)

Parameters

connectionString string

Connection string

Returns

ITableManager

Events

OnGetConnection

Event raised when the connection is required. Returns the connection.

public static event DataConnectionFactory.GetConnectionEventHandler OnGetConnection

Event Type

DataConnectionFactory.GetConnectionEventHandler