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
-
objectDataConnectionFactory
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
- 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
ProviderObject
Returns the provider object.
public static IDataProvider ProviderObject { get; }
Property Value
TableManagerObject
Returns the Table manager object.
public static ITableManager TableManagerObject { get; }
Property Value
Methods
GetConnection()
Returns a new database connection.
public static IDataConnection GetConnection()
Returns
GetConnection(string)
Returns a new database connection.
public static IDataConnection GetConnection(string connectionString)
Parameters
connectionString
stringConnection string
Returns
GetNativeConnection(string, bool)
Returns a new database connection.
public static IDataConnection GetNativeConnection(string connectionString, bool newConnection = false)
Parameters
connectionString
stringConnection string
newConnection
boolIf true, a new connection instance is created
Returns
NewTableManagerObject(string)
Creates a new table manager object with the given connection string
public static ITableManager NewTableManagerObject(string connectionString)
Parameters
connectionString
stringConnection string
Returns
Events
OnGetConnection
Event raised when the connection is required. Returns the connection.
public static event DataConnectionFactory.GetConnectionEventHandler OnGetConnection